MQTT and PCAPWM (espEasy + PCA9685)

Hello there

first of all, dear community, thanks for that great tool! I’ve installed it on my Hyper-V cluster and it worked out of the box. I’m saying that, because it makes two things clear: yes I like Hyper-V :smiley: and yes I’m a 100% Geek and techie :nerd: So I’ve started to have HA in virtualenv with Ubuntu (I love [!] Linux as well) I ordered some esp8266 (esp01) and started to automate. So far I run out of IP addresses in /24 but that’s a different story.

Now to my issue: One of them should actually set up my lighting in the living room. That works out quite well with a H801 (also ESP8266) dimmer and MQTT broker. But the espEasy + PCA9685 config won’t work.
The problem is, that I’m messing up subscriptions and push templates in MQTT and/or espEasy.
espEasy says:

  • Subscribe Template: “/%sysname%/#”
  • Publish Template: “/%sysname%/%tskname%/%valname%”

So I have in the configuration to dimm the channel 0

- platform: mqtt name: "TMP PCAPWM" state_topic: "/IoT02/PCAPWM/0" command_topic: "/IoT02/PCAPWM/0" brightness_state_topic: "/IoT02/PCAPWM/0" brightness_command_topic: "/IoT02/PCAPWM/0" state_value_template: "{{ value_json.state }}" brightness_value_template: "{{ value_json.brightness }}" qos: 0 payload_on: "4096" payload_off: "0" optimistic: false I assume the problem is in the topics, but I have no idea how to differ between "state" and "set" as I also don't know how to differ between Subscribe and Publish template in espEasy. I am so into that topic, that I don't see the problem. I know that it is not correct to have state and set in the same message cue, but I simply don't know how.

I have additional questions like:
Why does my chromecast audio (in a different LAN that is routed transparent) not show up?
How can I setup a trigger that is fired when I switch the input of my ONKYO receiver?
But I will ask them in a different Topic.

Regards, Lukas

I don’t know espEasy, but I assume hte ‘publish_template’ is the topic it publishes to. The ‘state_topic’ in configuration.yaml must then match the ‘publish_template’ you define in espEasy.

In the other direction, HA sends messages on a topic defined by command_topic and the espEasy node must subscribe to that topic to receive the commands.

If your espEasy node responds to commands by sending a state message, these two topics can be different, so that HA can update the state from that message, otherwise it is updated from the command message.

So on espEasy

Subscribe Template: "/IOT/command/0"
Publish Template: "/IOT/status/0"

On HA

- platform: mqtt
  state_topic: "/IOT/status/0"
  command_topic: "/IOT/command/0"

Thanks, that helped!