I’m having some problems receiving an update from MqTT as a switch. Am i doing something wrong? I know if i change it from SWITCH to STRING it works but i want it to be a togable switch in the sitemap.
Item:
Switch vgu10 "Demo GU10 BUlb [%s]" {mqtt="<[openhab:smartthings/Gu10/switch:state:default]"}
Openhab Log:
2017-01-22 00:07:50.594 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'vgu10'
mosquitto_pub message:
smartthings/Gu10/switch on
I can send commands fine with the following setup:
item:
Switch vgu10 "Demo GU10 BUlb [%s]" {mqtt=">[openhab:smartthings/Gu10/switch:command:ON:on], >[openhab:smartthings/Gu10/switch:command:OFF:off]"}
openhab log:
2017-01-22 00:04:08.487 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command ON to smartthings/Gu10/switch
2017-01-22 00:04:08.491 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored ‘vgu10’ with state ‘ON’ in mapdb database
2017-01-22 00:04:08.510 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for vgu10_switch
2017-01-22 00:04:08.512 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored ‘vgu10_switch’ with state ‘on’ in mapdb database
2017-01-22 00:04:10.954 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for vgu10
2017-01-22 00:04:10.957 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored ‘vgu10’ with state ‘OFF’ in mapdb database
2017-01-22 00:04:10.957 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command OFF to smartthings/Gu10/switch
2017-01-22 00:04:10.976 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for vgu10_switch
2017-01-22 00:04:10.978 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored ‘vgu10_switch’ with state ‘off’ in mapdb database
mosquitto_pub message:
smartthings/Gu10/switch on
smartthings/Gu10/switch off