Hi all,
I have an issues with Google when commanding it to switch on a light. It seems it doesn’t restore the last state, but instead sending some defaults. e.g. dimmed to just 10%. Which is a bit annoying.
About my System
- Platform information:
- Hardware: RaspberryPi 3 B+
- OS: Linux openhab 4.19.66-v7+
- Java Runtime Environment: Raspberry openjdk version “1.8.0_222”
- openHAB version: 2.4.0 (Build)
I’m using a Tasmota RGB LED Strip, accessd via MQTT: (excerpt), and exposed is the HSBColor Item to Google via the “Lighing” Tag.
Thing definition
Thing topic Tasmota_smart_A355B4 "Tasmota RGB Schreibtisch" {
Channels:
Type switch : PowerSwitch [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF", commandTopic="cmnd/smart_A355B4/POWER", on="ON", off="OFF", postCommand=true]
Type colorRGB : ColorRGB [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.Color" , commandTopic="cmnd/smart_A355B4/Color", rgb=true ]
Type colorHSB : ColorHSB [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.HSBColor" , commandTopic="cmnd/smart_A355B4/HsbColor", rgb=false ]
Type number : Scheme [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.Scheme", min=0, max=4, commandTopic="cmnd/smart_A355B4/Scheme", min=0, max=4]
Type switch : Fade [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.Fade", on="ON", off="OFF", commandTopic="cmnd/smart_A355B4/Fade", on=1, off=0]
Type switch : GammaCorrection [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.LedTable", on="ON", off="OFF", commandTopic="cmnd/smart_A355B4/CT", on=1, off=0]
Type number : ColorTemperature [ commandTopic="cmnd/smart_A355B4/CT", min=153, max=500 ]
Type number : Brightness [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.Dimmer", min=0, max=100, commandTopic="cmnd/smart_A355B4/Dimmer", min=0, max=100]
Type number : Speed [ stateTopic="tele/smart_A355B4/STATE", transformationPattern="JSONPATH:$.Speed", min=1, max=20, commandTopic="cmnd/smart_A355B4/Speed", min=1, max=20]
}
Item definition
Group RGBLED02 "RGB Schreibtisch"
Switch Tasmota_RGB02 "Schreibtischlich Schalter" (RGBLED02,RGBLights) {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:PowerSwitch"}
Color Tasmota_RGB02_Color "Schreibtisch RGB" (RGBLED02,RGBLights) ["Lighting"] {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:ColorHSB"}
Number Tasmota_RGB02_Speed "Geschwindigkeit [%d]"( RGBLED02,RGBLights) {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:Speed"}
Number Tasmota_RGB02_Scheme "Szenario [%d]" (RGBLED02,RGBLights) {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:Scheme"}
Switch Tasmota_RGB02_Gamma "Gammakorrektur" (RGBLED02,RGBLights) {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:GammaCorrection"}
Number Tasmota_RGB02_CT "Farbtemperatur" (RGBLED02,RGBLights) {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:ColorTemperature"}
Switch Tasmota_RGB02_Fade "Weicher Übergang" (RGBLED02,RGBLights) {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:Fade"}
Specific line:
Color Tasmota_RGB02_Color "Schreibtisch RGB" (RGBLED02,RGBLights) ["Lighting"] {channel="mqtt:topic:SHGMQTTBroker:Tasmota_smart_A355B4:ColorHSB"}
when i say “OK google, switch on Schreibtischlicht” (alias for “Schreibtisch RGB”), Google switches it on with the following values (queried via MQTT subscibtion):
30,59,100
qos : 0, retain : false, cmd : publish, dup : false, topic : cmnd/smart_A355B4/HsbColor, messageId : , length : 37, Raw payload : 514844535744494848
What kind of Things, Items have you defined and what are you exposing how to get a light switched on with the last state or some specific values?
Thanks,
Rob