Interesting touch switch lanbon l8

I can’t find a way to get the relay state. I think there isn’t a topic for it.

hasp/plate01/state/output1 doesn’t exist

I can turn it on and off, but no way to check state.

@fvanroie Any suggestions?

Thank you

Thanks for those pictures! We’ve since found out that the 4-byte serial communication seems to be going over K3 – IO12 (115200 baud, 8data, 1stop, no parity).

image

and the state would be
hasp/plate01/state/output1
??

state is not currently implemented, we’re reworking that part of the code to make it more intuitive… While output is now heavily based on the groupid, it was mentioned that this is rather complicated and not intuitive to use. So back to the drawing board :slight_smile:

@fvanroie thank you.
I want to also thank you for producing this firmware.
These lambon switches with your firmware are a pretty powerful interface.
Looking forward to being able to use the relays.

Could you explain in more detail?

  • platform: mqtt in openhasp: ?

You create an mqtt switch/light with below command topic and payload options

You can’t get the state. No more for now.

hasp/plate01/command/output1
payload 1 or 0

Major rework is planned for gpio handling in v0.4.1 0.6.0.
I will keep you updated in this post when more info becomes available for testing.

2 Likes

Thank you very much. Using the relay functionality is a welcome addition.

@dgomes
Good day, I set up the custom components via HACS, so I’m on the “latest” which calls for firmware 5.
I’ve uploaded firmware 5 and with the readme tweaks works fine.
Any news on the relay command ? state is at hasp/plate01/state/relay12 but havent dont know the command topic/payload.
Thank you

Hi @juan11perez,

still work in progress :frowning:

we focused on a couple of new features this last sprint, such as native page navigation and solving important issues/bugs, which make this last version the first where the firmware and the custom component (CC) will be released in tandem.

I invite everyone to join us on discord, to track the development and become beta testers :smiley: https://discord.gg/SJk6d56u

2 Likes

@dgomes thank you for the update and invitation. Looking forward to the release.

Dear Guys, dear community,

I’m trying for more than 10 hours to flash a Lanbon L8 with OpenHASP. I dont know where my mistake is, but my Esp-Flasher always tells me

“Unexpected error: ESP Chip Auto-Detection failed: Failed to connect to Espressif device: Timed out waiting for packet header”

I have connected my Lanbon L8 with a USB TTL. I have connected RX, TX, 5V and Ground in Top Line. In bottom line I have connected GPIO0 with Ground in Top Line. If I plug USB in USB Adapter, the LCD is White, nothing is on the screen, only white. But I cant flash. In my USB TTL I have set Pin to 5V.

Can you please help me?

Thank you very much and best regards from germany,
Jonas

Flashing instructions here Custom Firmware on Lanbon L8 LCD Touch Switch | Blakadder's Smarthome Shenanigans

Also check out Flash Lanbon L8 without opening · Discussion #76 · HASwitchPlate/openHASP · GitHub with detailed steps and photos.

The first tests sending serial commands to the L8-HD dimmer seem to be working, except for the off command atm. If I can get that sorted, L8-HD is on track to be included in openHASP 0.6.0.

update: L8-HD off is working now too, dumb mistake with serial.print instead of serial.write.

2 Likes

I’ve recently hooked up a few Lanbon LS-HS’s to some lighting circuits in my flat and i was determined to get them working with Home assistant using Openhasp. I started out with the stable v0.5.1 firmware for the L8 and wasn’t getting anywhere as it didn’t seem like any of the output commands would actually toggle the gpio outputs, but thanks to some help from fvanroie i ended up using the v0.6.0 dev build which apparently has improved gpio support.

After a bit of experimenting it turns out that in order to get the GPIO’s to change you can’t currently use the GPIO groups and have to use the GPIO pin numbers themselves. As an example, for the Lanbon L8-HS Relay 1 is connected to GPIO pin 12. What you have to do is send the payload to hasp/<mqtt_topic>/command/output12 in order to get Relay 1 to switch. In addition, the payload can’t be 1, on or true. The way i could get it to switch was to set the payload to {“state”:1} or {“state”:0}, then the relay switches. The other outputs on the Lanbon L8-HS are connected to GPIO’s 14 and 27 and i’ve confirmed those work in the same way.

At the moment with the current dev build i’ve potentially found another quirk which caused me a bit of confusion til i figured out what was going on. In order for these MQTT commands to work i needed to include an object on a page that was linked to the GPIO group and that object had to be manually activated on the plate at least once before the MQTT commands would work. That means after every reboot of the plate you needed to manually press each object once to allow it to be operated using MQTT. I confirmed this behaviour on four of the Lanbon’s, but if anyone else fancies trying this then could you let fvanroie know if you had the same issue or if it was something i was doing?

In order to get this working in Home assistant i’ve created a lighting template that sends the appropriate MQTT command when it’s turned on and off. In addition, i’ve linked that value and state of the light template to the object on the plate, so that way it doesn’t matter if the light is switched by the plate or by Home assistant, they both show the correct state and stay in sync.

As an example you could send the following jsonl to the plate:

{"page":1,"id":1,"obj":"btn","x":3,"y":40,"w":234,"h":130,"toggle":true,"groupid":"1","text":"Hall Lights \uE335","text_font":32,"mode":"break","align":1}

With that programmed you could add the following to the your home assistant configuration.yaml file:

light:
  - platform: template
    lights:
      hall_light1:
        friendly_name: "Hall light entrance"
        turn_on:
          service: mqtt.publish
          data:
            topic: hasp/mainlight_hall/command/output12
            payload: '{"state":1}'
        turn_off:
          service: mqtt.publish
          data:
            topic: hasp/mainlight_hall/command/output12
            payload: '{"state":0}'

openhasp:
  mainlight_hall:
  topic: "hasp/mainlight_hall"
  idle_brightness: 35
  objects:
    - obj: "p1b1"  # light-switch toggle button
      properties:
        "val": '{{ 1 if states("light.hall_light1") == "on" else 0 }}'
        "text": '{{ "Hall Lights \uE6E8" if is_state("light.hall_light1", "on") else "Hall Lights \uE335" | e }}'
      event:
        "up":
          - service: homeassistant.toggle
            entity_id: "light.hall_light1"

This will create a light entity that will send the MQTT command to switch the lights on and off when it’s switched in home assistant, but the openhasp instance keeps everything in sync so even if you switch the lights on the plate the light entity in home assistant will update. This also means that if you want to switch the light on or off from another plate you just link it to the template. The only restriction at the moment is that if you have to reboot the Lanbon for whatever reason you need to manually switch the object linked to the gpio group before it can be controlled by home assistant.

I should also mention that i have the HACS openhasp repo installed and it’ll give a warning that the plates are running a different version of the firmware than it’s expecting.

1 Like

Maybe I am missing something, but isn’t that just an mqtt json schema MQTT Light - Home Assistant

Yep, you’re correct, but the documents for the v0.6.0 release haven’t been released yet and the previous documents state that the outputs are triggered using hasp/<mqtt_topic>/command/output1 with payload “1, on or true”. This is just so people can get something they might have installed working until a more official solution becomes available.

2 Likes

Thanks for testing the openHASP 0.6 build and help to iron out the quirks. The 0.5 docs obviously don’t apply to the 0.6 development firmware as there are quite some changes, specifically to the gpio handling.

Meanwhile, @dgomes has updated the custom component to test the 0.6 functionality as well, which includes HA entities for configured gpios.

We are coming around to updating the 0.6 docs bringing us closer to a formal release.

3 Likes

Hello, What is the correct relay MQTT command message to Lanbon L8? I try relay group → outputX, GpioX. I try 1-0,on-off, but not working. On LCD panel I can control the relay, but mqtt not working.

Which firmware?