#how on earth to configure a single lamp over mqtt

1 messages · Page 1 of 1 (latest)

cunning geyser
#

it should be sooo easy but somehow i don't get it.
most likely it's not for my type of lamp controller

its like sooo easy just send
{
"brightness": 67,
"state": "ON"
}
to /lamps/a-room/lamp

but if i try to get that to work in the "config your device" in the mqtt thing you get to add the device, you select its a lamp and then suddenly bullshit

it sends raw numbers to somewhere.
there is no example nothing.

the lamp just needs to read or send that data over mqtt

what to do?
what to select in this mask whats next.

how value to json to mqtt, how mqtt to data so to speak.

rigid crescent
#

I haven't tested this, but I think this will get you what you need:

mqtt:
- light:
    name: Super cool light
    schema: json
    command_topic: lamps/a-room/lamp
    state_topic: lamps/a-room/lamp
    supported_color_modes: ['brightness']
    brightness_scale: 100 # change to match the max brightness of your light
fiery prism
#

What is the device you try to connect?

For better experience it would be better if it used a separate command and state topic so you have feedback. Same for an availability.

cunning geyser
#

LED Controller, Tuya, TS0501B, C01Z

its over zigbee2mqtt. zigbee2mqtt found it and has a nice input - but it's verry hard to get that to work like fo example a hue lamp. wit hte integration shown by "Tediore" i get them to "function" i can controll them somehow but with commandtopick a /set added.
hopw to do a get i don't know. how to get it to behave like a device? i don't know. i can't move it ioto a room

#

basically i have now plonked that in:

mqtt:
- light:
    name: Dimmable Lamp Glass
    schema: json
    command_topic: zigbee2mqtt/lights/wohnzimmer/glasbrett-0xa4c138da53c02a24/set
    state_topic: zigbee2mqtt/lights/wohnzimmer/glasbrett-0xa4c138da53c02a24
    supported_color_modes: ['brightness']
    brightness_scale: 255 # change to match the max brightness of your light
rigid crescent
#

do you HA MQTT discovery enabled in zigbee2mqtt?

#

that will then create a Device™ in HA

cunning geyser
#

no

rigid crescent
#

any particular reason? that would be immensely helpful in this case

cunning geyser
#

i didn't like the autonaming feature - and renaming is hard and goes heywire.
this is my first lamp everything else are sensores buttons occupancy sensores and so on. and i handle everything with topic names.

like:
zigbee2mqtt/sensor/temperature/wohnzimmer/wand-bilder-0xa4c138c21c332967

or

zigbee2mqtt/motion/Kuche/0x001788010df93dd4

or

zigbee2mqtt/button/Wohnzimmer/0xdc8e95fffecd1bec

rigid crescent
#

if you really don't want to enable auto-discovery, then you'd need to fill in the device part of the MQTT light config to add it to a Device

cunning geyser
#

yeah tried that but i did'nt get it at all. thats the picture i uploaded.

#

i am literally to dumb for that

#

it'S not clicking

rigid crescent
#

honestly I still think you'd be better off with MQTT discovery

#

I've found renaming to be pretty straightforward in the z2m UI. What issues were you having?

cunning geyser
#

ok it worked but created a mess.
fine.
then i have to do it like i do with hue. shut ha down - learn new devices, name them, then turn ha back on

rigid crescent
#

wut

cunning geyser
rigid crescent
#

really though, what issues were you having with renaming devices in z2m? I haven't had to do what you're describing above and I haven't noticed any issues with renaming

cunning geyser
# rigid crescent wut

yeah like light.color_spot_25 is not really nice but that is what you'll get.
if you shut down , include, rename, boot then you'lll get

light.kitchen_countertop_left

rigid crescent
#

I have never experienced that

#

It's been as simple as renaming in z2m after pairing and the device and entities in HA get updated with that name

cunning geyser
#

ok for lamps i only use that pesky hue bridge. maybe it's because of that.
like i said not used z2m outside of sensors and buttons up until now.

but one try showed me a similar behavior like hue. that's why i rejected using the ha integration.

rigid crescent
#

initially it will come through like light.0xdeadbeefcafe0000 (the zigbee device's IEEE address), but when you rename it in z2m, it will get updated automatically

#

no rube goldberg machine required

cunning geyser
#

basically i started homeassistant to controll hue and brightness by sun elevation ... that was my main reason to start with it.
it had the nicest interface. but i miss something like blockly as programming interface.

ok thank you i'll try it out next time.

it works now ~ at least for the most part.
the room lights entity does not include the mqtt lights.
but i guess that light.<roomname> is from hue

rigid crescent
#

time to ditch the hue bridge 😎

cunning geyser
#

😩 that's a future me probleme.
at the moment i'm just happy my new lights work.

blazing pike
#

Hello, I forgot my password. How do I recover it to enter my house?

#

Hello, I forgot my password. How do I recover it to enter my house?

#

?

sudden briar
#

but also, please don't hijack threads, make your own.

fiery prism
#

Every device from Z2M should just pop up in HA if you have HA Discovery enabled in Z2M and Discovery enabled for the MQTT integration. Painless integration 🙂

cunning geyser
#

home assistant is a pain. it looks nice but has little functionality.
they choose to force yamel and jinja on everything and jinja does not work in most cases - not that it does not do what you want but just it deos not work at all. typical examle would be:

light:
  - platform: group
    name: "Alle Wohnzimmer"
    entities: >
      {%set data = namespace(lamps=[], offlamps=[])-%} 
      {%set area = "wohnzimmer" -%}
      {%set arealamps = states.light | selectattr('entity_id', 'in', area_entities(area)) | 
        rejectattr('entity_id','==', "light." ~ area) | map(attribute='entity_id') | list-%}
      {%for lmp in arealamps-%}
        {%if is_state(lmp, "on")-%}
          {%set data.lamps = data.lamps + [lmp]-%}
        {%else-%}
          {%set data.offlamps = data.offlamps + [lmp]-%}
        {%endif-%} 
      {%endfor-%}   
      {%if data.lamps | count -%}
        {{data.lamps}}
      {%else-%}
        {{data.offlamps}}
      {%endif-%}

the more i want to do the less it seems to be capable of doing.
yes using the automatic integrations work - as long as they work. as soon as i have something that does not do it automatically i am stuck.

and that home assistant has no other option outside of static yammel and basically little support for scripting over all it's just sad.
but - the integrations are great, the ui is perfect.

sudden briar