No payload_off in MQTTtoRF2 in homeassistant

Hi, with auto discovery I do see my RF2 (kaku) actions and entries. However the on/off are both sticked together on the playload_on, and there is no payload_off. I cannot switch my controlers off, because it sends the default payload ‘off’ to the gateway.
I can resolve this at HomeAssistant, but I think its a bug, I like to have so minimal config files as possible

name: RF2_2_0_33205398
unique_id: 2462ABF1B6F8RF2_2_0_33205398
payload_on: >-
  {"unit":2,"groupBit":0,"period":227,"address":33205398,"switchType":1}{"unit":2,"groupBit":0,"period":227,"address":33205398,"switchType":0}
command_topic: home/OpenMQTTGateway/commands/MQTTtoRF2

yeah, I don’t think the mqtt discovery for KAKU is implemented, let me take a look

1 Like

You should see 2 switches created automatically, one for ON, one for OFF. This means that only the payload_on will be used when using the switch. Payload_on would be an ON command from the ON switch or an OFF command from the OFF switch.

I suppose that you would like to see one switch that leverage payload_on and payload_off ?

I think I do would like a a toggle instead of two buttons, altho without a feedback loop it’s a presumed state with
kaku.

For now I don’t get payload_off in my homeassistant.
Thanks a lot for looking into it!

Now I see that its only in the dev branch. Master seems to work!
I am very happy with your software.

1 Like

Isn’t this a bug in OpenMQTTGateway?

Stmt 82 - 85 in Zgatewayrf2 reads:
serializeJson(data, payloadonstr);
data[“switchType”] = 0; // switchtype = 0 turns switch off.
serializeJson(data, payloadonstr);
data[“switchType”] = org_switchtype; // Restore original switchvalue

This should be:
serializeJson(data, payloadonstr);
data[“switchType”] = 0; // switchtype = 0 turns switch off.
serializeJson(data, payloadoffstr);
data[“switchType”] = org_switchtype; // Restore original switchvalue