433mhz, infrared IR to and from MQTT on ESP8266

Hi,

Maybe others HA expert will have a better advice but I think you should set the optimistic value to false so as to take into the gateway feedback.

But first, your states seems to be commented, I will uncomment them before changing the optimistic parameter. It is possible that HA go into optimistic mode per default as it can’t see the expected state values.

Hey,

Thanks for your speedy response - got it working now!

I set up 6 variations of the switch with different quotes, some as strongs, some as values etc… and in the end they all work which is quite frustrating for a beginner that 6 different versions of a code all do the same thing!

Thank you so much!

- platform: mqtt
  name: “Energenietest1”
  state_topic: OMG/OpenMQTTGateway/433toMQTT
  command_topic: OMG/OpenMQTTGateway/commands/MQTTto433
  value_template: '{{ value_json.value}}'
  payload_on: '{"value":"13451403","protocol":"1","length":"24","delay":"212"}'
  payload_off: '{"value":"13451402","protocol":"1","length":"24","delay":"212"}'
  state_on: "13451403"
  state_off: "13451402"
  # optimistic: true
  retain: true
  qos: "0"

  #dont toggle
- platform: mqtt
  name: “Energenietest2”
  state_topic: OMG/OpenMQTTGateway/433toMQTT
  command_topic: OMG/OpenMQTTGateway/commands/MQTTto433
  value_template: '{{ value_json.value}}'
  payload_on: '{"value":13451403,"protocol":1,"length":24,"delay":212}'
  payload_off: '{"value":13451402,"protocol":1,"length":24,"delay":212}'
  state_on: "13451403"
  state_off: "13451402"
  # optimistic: true
  retain: true
  qos: "0"

# dont toggle
- platform: mqtt
  name: “Energenietest3”
  state_topic: OMG/OpenMQTTGateway/433toMQTT
  command_topic: OMG/OpenMQTTGateway/commands/MQTTto433
  value_template: '{{ value_json.value}}'
  payload_on: '{"value":"13451403"}'
  payload_off: '{"value":"13451402"}'
  state_on: "13451403"
  state_off: "13451402"
  # optimistic: true
  retain: true
  qos: "0"

  # dont toggle
- platform: mqtt
  name: “Energenietest4”
  state_topic: OMG/OpenMQTTGateway/433toMQTT
  command_topic: OMG/OpenMQTTGateway/commands/MQTTto433
  value_template: '{{ value_json.value}}'
  payload_on: '{"value":"13451403"}'
  payload_off: '{"value":"13451402"}'
  state_on: 13451403
  state_off: 13451402
  # optimistic: true
  retain: true
  qos: "0"

- platform: mqtt
  name: “Energenietest5”
  state_topic: OMG/OpenMQTTGateway/433toMQTT
  command_topic: OMG/OpenMQTTGateway/commands/MQTTto433
  value_template: '{{ value_json.value}}'
  payload_on: '{"value":13451403}'
  payload_off: '{"value":13451402}'
  state_on: "13451403"
  state_off: "13451402"
  # optimistic: true
  retain: true
  qos: "0"

- platform: mqtt
  name: “Energenietest6”
  state_topic: OMG/OpenMQTTGateway/433toMQTT
  command_topic: OMG/OpenMQTTGateway/commands/MQTTto433
  value_template: '{{ value_json.value}}'
  payload_on: '{"value":13451403}'
  payload_off: '{"value":13451402}'
  state_on: 13451403
  state_off: 13451402
  # optimistic: true
  retain: true
  qos: "0"
1 Like

Can you use two transmitters on the one esp8266. RF transmitter and a IR on the same board. Both on different pins and using the same library ?

Yes you can have an IR transmitter and an RF transmitter on the same board. You can also add an RF receiver and an IR receiver.