Intrigrating Moonside T1 (Lighthouse)

I know people have been trying to get a Moonside Lighthouse lamp to work with Homeassistant. I was finally able to get basic connectivity with it (locally!). It uses an ESP32 module to talk it via BLE. This project is still very work in progress. I’ve written an article on my blog where I describe the stuff I was able to extract: Reverse engineering a Moonside Lighthouse Light – Thegreydiamond. Here is a link for the Sketch: A demo sketch showing how you can control a Moonside light fixture · GitHub. I’m hopping to get an integration for ESPhome running soon. I will keep this topic updated.

(If this is considered to advertisy - I can happily remove this again)

3 Likes

Has there been any progress on this? Moonside has been expanding their product lineup somewhat (I have the new Neon Hex) and I think these lights could make great use of HA’s new Bluetooth integration.

Nothing really happened. I don’t use home assistant Bluetooth stuff honestly and didn’t find any time to look into it. Maybe I will dig into this somewhat. Like I said I can’t really buy all Moonside products to build support for them :sweat_smile:
Though I hope that if I would build a solid foundation other people will be able to expand on that.

Thanks for your work so far!
Your current gist doesn’t integrate with home assistant yet, right?

Yup, it does not. I was unable to get it working while tinkering. I will pick up on this at some point…

Hi! Just wondering if there has been any progress? I also have a Moonside Lighthouse, and when I link it to Alexa/Google, it stops responding a few days later to cloud services for some reason, forcing me to open the Moonside app every time. I would really want to make some HA automations. My Rasp Pi 4 Home Assistant is in the same room. Being able to even just turn it on/off with HA over bluetooth would be so great. Amazing work investigating the wireless command info needed

Hi!

I have just been able to control the lighthouse via the public API provided by the company, but as the documentation says, you can only turn it on/off, that’s all.

Also it seems like after some time the light disconnects from Wifi, so you can’t control it anymore. Even locally, I had to switch to Bluetooth to turn it on, then switch to Wifi so it connects, then I was able to control it again via the API. @hypnotoadskin probably that’s why you can’t use the integrations with Alexa/Google after a few days :frowning:

IMHO in it’s current state, it would be a waste of time developing anything that uses the public API. Really a pity.

I guess for now the BLE connection is the way to go. Thanks @TheGreyDiamond for the effort :metal:

Take care people!

Yeah, I played around with HTTP Posts messages as well and had the same experience. Only able to power on/off. I unfortunately still had no luck getting the home assistant to connect to the Lighthouse with bluetooth. Somehow, and I’m not sure what I did, I managed to get the moonside to connect to Wifi and stay connected. Again, I have no idea what I did differently, given the buggy-ness of the app, it is likely a fluke. It’s been working on wifi for about a week now. In HA, I just use the google sdk integration with the command “Toggle moonside light” which has a delay, but works. I can also send commands to change it’s color and brightness, but I’m not able to switch themes or get its state.
A youtuber made a great video about making your own bluetooth integration

The problem is this came out before HA updated it’s bluetooth, so the instructions here don’t work. He promised to make an updated video and once he or anyone else makes a tutorial I’ll try again.

1 Like

I had some time to work on this and have some wonderful updates for anyone interested. Basically, I got an ESP32 to control the light directly over BLE in ESPhome with Home Assistant! The trick is getting the ble commands into the correct format.
Here’s how a proper ble command looks like…
</>

        - ble_client.ble_write:
            id: lighthouse_ble
            service_uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
            characteristic_uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
            value: [insert hex formatted command here]

</>
Using the reverse engineered info, we have all the commands for on/off, setting themes, colors, brightness, etc
Use this site to convert the command string to hex (Capitalization matters!)

Break the hex into pairs and add a “0x” in front of each to make a byte
So “LEDON” becomes [0x4c, 0x45, 0x44, 0x4f, 0x4e]
Here are examples of buttons I’ve made in ESPHOME…

esp32_ble_tracker:

ble_client:
  - mac_address: 24:5C:AB:80:86:82
    id: lighthouse_ble

button:
  - platform: template
    name: "1-Turn ON Moonside Lighthouse"
    id: lighthouse_on
    on_press:
      then:
        - ble_client.ble_write:
            id: lighthouse_ble
            service_uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
            characteristic_uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
            value: [0x4c, 0x45, 0x44, 0x4f, 0x4e]

  - platform: template
    name: "2-Turn OFF Moonside Lighthouse"
    id: lighthouse_off
    on_press:
      then:
        - ble_client.ble_write:
            id: lighthouse_ble
            service_uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
            characteristic_uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
            value: [0x4c, 0x45, 0x44, 0x4f, 0x46, 0x46]

  - platform: template
    name: "Night Fire"
    id: night_fire
    on_press:
      then:
        - ble_client.ble_write:
            id: lighthouse_ble
            service_uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
            characteristic_uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
            value: [0x46, 0x49, 0x52, 0x45, 0x31, 0x2E, 0x32, 0x30, 0x2C]
  - platform: template
    name: "Blending Rainbow"
  
  id: blending_rainbow
    on_press:
      then:
        - ble_client.ble_write:
            id: lighthouse_ble
            service_uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
            characteristic_uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
            value: [0x54, 0x48, 0x45, 0x4D, 0x45, 0x2E, 0x52, 0x41, 0x49, 0x4E, 0x42, 0x4F, 0x57, 0x33, 0x2E, 0x30, 0x2C]
1 Like