this works super well, but I bump against the restrictions of only having an entity and no object / area etc.
With the help of 123 taras in an other topic, he guided me well and gave me a solution for my ‘normal lights’
these just send true and false and on and off, so no real logic is required.
The dimmers as you can see above have some more logic bound to them as they provide a changeable brightness.
thus my new payload needs to contain this logic, but since I’m a noob at programming i don’t know how i can provide this ‘new payload’ with my dimmer logic.
can i just start an if else statement in that payload? etc
thx for the effort
you made the code alot more efficient
but the first block of code I posted is completely functional (well it fulfills my need anyway )
I don’t want to use the first block no more, i want to do it with the autodiscovery topic which i started to write in the second block.
so my question is how to I integrated that command_on part into that
this is the way i was able to get a normal relay up and running, and i want to do the same for a dimmer:
the test mqtt script creates device + entity does it not?
while the ‘old’ thing only creates an entity without a ‘connected’ device or area setting options (want to use them with new area card)
ok thx, the unique id seems to allow me to assign it to an area,
it does however not seem to create a Device ,
but I will call this low impact great succes since my goal for now was the area assignment