Neu: Die KI-Firewall überwacht die gesamte Plattform und erklärt jeden Vorfall in einfachen Worten. So funktioniert es

Switching Wi-Fi bulbs from a board Switch through my Pi, no vendor app

Switching Wi-Fi bulbs from a board Switch through my Pi, no vendor app

Gelöst 7 6

Me again (the gas meter guy). Next project: the lights in our hallway and living room. I want to turn them on and off from a Switch on my Hermetry board, and later from rules. I don’t want to depend on a bulb vendor’s phone app, so the idea is the Raspberry Pi talks to the bulbs on my home network.

Are there smart bulbs that a Pi can control directly over the LAN? And how does the board Switch reach the Pi? I tried adding a Switch card but it says „Choose a command in this widget’s settings“ and the command list is empty.

Ask me about 4–20 mA.
♥ 2

How much are bulbs like that? Thinking about it for the office

Still waiting for the gateway to reconnect.
♥ 0

Will the switch show if someone turned the light on at the wall?

♥ 2

Did this at home last winter. Bulbs: pick ones with a documented local LAN API. WiZ bulbs take JSON over UDP port 38899, LIFX has its LAN protocol, both work from Python without any cloud account once they’re on your Wi-Fi. Around 10-15 GBP each.

The list is empty because the Switch can only send commands from the device profile’s Commands catalog. So:

1. On the Pi’s profile, Commands tab, add light.set, tier Basic, parameters room (Choice: hallway, living) and on (Yes / no). Boards send only Basic tier catalog commands, a Privileged one gets refused on a board.
2. On the Pi, handle v1/rpc/req/+, switch the bulb, answer on v1/rpc/res/{id}, and publish the real state as telemetry, as numbers: {"hallway_on": 1}.
3. Switch card settings: When this control is used, Run a command, device = the Pi, command light.set, room as a fixed value, on from the control’s value. Then bind Current state to hallway_on.

That last step answers David: the Switch shows what the Pi reports, so poll the bulb every 30 s or so and publish it, then a wall switch change shows up too. With a wall switch cutting power the bulb is just gone, so leave the wall switches on. Details on Control cards.

Akzeptierte Lösung♥ 1

And whoever uses the board needs the permission to run widget commands, or the Switch just says no. Caught a colleague out at work.

♥ 1

Why does it have to be a catalog command, couldn’t the board send anything?

♥ 0

On purpose. A board is something many people click, so it only gets the safe commands you listed.

♥ 0

Working! Got two WiZ bulbs. The command list filled up as soon as I added light.set to the catalog. First version the Switch only ever showed its Unknown text, because I hadn’t bound Current state yet. Bound it to hallway_on and it stays put now, even when my wife uses the bulb’s own button.

Ask me about 4–20 mA.
♥ 0
Ansicht von 8 Beiträgen – 1 bis 8 (von insgesamt 8)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.

Mitdiskutieren

Melde dich an, um Fragen zu stellen und zu beantworten, hilfreiche Beiträge mit „Gefällt mir“ zu markieren und die Antwort zu kennzeichnen, die dein Problem gelöst hat. Jeder Beitrag bringt Punkte und Stufen.

Teilen