What i'm doing wrong?

Avatar
  • updated

Image 4874

Image 4875Image 4876Image 4877Image 4878

Hello. So, i'm trying to connect a Shelly 2.5 in relay mode (2 channels). I want to control channels, which works fine, to get the Switch value (if the switch it's on or off) and to find out the consumption on any channel. (in case one switch it's on, but the consumption is 0, it's means there's a problem, and i want to message the client that the lamp it's broken). I can see in subscription de actual value, in all my necessary, but i really don't know how to put the value from subscriber, into the parser. (ex: The instant consumption from the led bulb, from subscriber, into consumption panel value) . I'm a MQTT beginner, don't really know how it's works, but i try to do my best. 

Thank you very much!

Avatar
Jürgen Jürgenson

Hey

Easy way to find out the json path is to copy its response data(Last message under values tab) value to https://jsonpathfinder.com/ copy the path after x and paste it into bOS parser. I think its .power

Avatar
Alexandru Dumbravă
Quote from Jürgen Jürgenson

Hey

Easy way to find out the json path is to copy its response data(Last message under values tab) value to https://jsonpathfinder.com/ copy the path after x and paste it into bOS parser. I think its .power

Hello

I used MQTT explorer, which show me live what actions i do in the app and what is my token name (path). just tried .power , 1/power, power. i think maybe the problem it's on publish. Thank you.

Avatar
Jürgen Jürgenson
Quote from Alexandru Dumbravă

Hello

I used MQTT explorer, which show me live what actions i do in the app and what is my token name (path). just tried .power , 1/power, power. i think maybe the problem it's on publish. Thank you.

I'm not sure why you are trying to publish values back to it? If you are trying to read out info then it should be under the subscription only. Can you paste the Last message value that you get for the power under the subscription?

Avatar
Alexandru Dumbravă
Quote from Jürgen Jürgenson

I'm not sure why you are trying to publish values back to it? If you are trying to read out info then it should be under the subscription only. Can you paste the Last message value that you get for the power under the subscription?

that's what i'm trying. i'm don't want to send it back to shelly, i want to see the parsers in the panel, but i only can see it subscriber last message.

Avatar
Alexandru Dumbravă
Quote from Alexandru Dumbravă

that's what i'm trying. i'm don't want to send it back to shelly, i want to see the parsers in the panel, but i only can see it subscriber last message.

If i use only subscriber to see the value, the value is text value, and i can't control nothing with it

Avatar
Jürgen Jürgenson
Quote from Alexandru Dumbravă

that's what i'm trying. i'm don't want to send it back to shelly, i want to see the parsers in the panel, but i only can see it subscriber last message.

I dont have the same model to test with. But you could also try to get the last message as a string:

Image 4880

For Shelly HT battery values - i'm subscribing to /status/devicepower:0
With the last message info: {"id": 0,"battery":{"V":5.15, "percent":57},"external":{"present":false}}

Battery voltages token name will be then:

Image 4881

Avatar
Alexandru Dumbravă
Quote from Jürgen Jürgenson

I dont have the same model to test with. But you could also try to get the last message as a string:

Image 4880

For Shelly HT battery values - i'm subscribing to /status/devicepower:0
With the last message info: {"id": 0,"battery":{"V":5.15, "percent":57},"external":{"present":false}}

Battery voltages token name will be then:

Image 4881

it's worked to make the value as a string in variables. not as parser. also, i can see the input in that way, as a string type. But i can't do nothing with those informations, because they ar just text. it's any way to convert string type to double or bolean in comfort click? Thank you!

Avatar
Jürgen Jürgenson
Quote from Alexandru Dumbravă

it's worked to make the value as a string in variables. not as parser. also, i can see the input in that way, as a string type. But i can't do nothing with those informations, because they ar just text. it's any way to convert string type to double or bolean in comfort click? Thank you!

What if you sub to only /relay/1 leave the power out for now in sub token. Then you should get a json string as the last message not just the value for power. Then try to find the correct path for the power value.

Avatar
Alexandru Dumbravă
theoretically, the token name is " .meters[1].power ". but i still can't see the value in the perser