[SOLVED] Shelly 2 power reading over MQTT

I’m trying to achieve Shelly2 power readings using stock firmware over MQTT.
Switch conrtol itself works fine, but I’m not able to see power in OH interface.

Item configuration is as follows:
Number Shelly_V2 “Ceiling [%.1f W]” (FF_Ieva) {

autoupdate=“false”, mqtt=" >[broker:shellies/shellyswitch-32B67E/relay/power:command:*:default)], <[broker:shellies/shellyswitch-32B67E/relay/power:state:default)]" }

In the log I have following message:
2018-11-16 00:35:52.914 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn’t post update for ‘Shelly_V2’

Do you see power in the Shelly App? I have got some Shelly´s but I also can´t see power in the android app.

As it’s a shelly 2, it may be power1 or power2?

use a mqtt sniffer like mqtt spy to see all mqtt messages dependend to your shelly 2.

No, despite the fact that there are 2 switches, power metering is common.
Could not find configuration example for Openhab, but for Home Assistant is is as follows:
"
sensor:

  • platform: mqtt
    name: “Family Room Shelly Power”
    state_topic: “shellies/shellyswitch-9F6008/relay/power”

  • platform: mqtt
    name: “Stairs Shelly Power”
    state_topic: “shellies/shellyswitch-9F5ED/relay/power”


Even though the Shelly2 has two relays, there is only one power monitoring chip.
"

There are errors in you binding definition, for example extraneous )
You also don’t need the outbound definition as it is a read only item and therefore you can remove the autoupdate="false"

Number Shelly_V2 “Ceiling [%.1f W]” (FF_Ieva) { mqtt="<[broker:shellies/shellyswitch-32B67E/relay/power:state:default]" }

This is assuming that the topic is correct

2 Likes

Thanks, it works

Please tick the solution mark under the relevant post:
hc_292