1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[GH-ISSUE #472] [Feature]: Allow Switching Power via MQTT / Implement REST API #294

Closed
opened 2026-05-07 00:08:33 +02:00 by BreizhHardware · 7 comments

Originally created by @Percy2Live on GitHub (Feb 20, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/472

Originally assigned to: @maziggy on GitHub.

Problem or Use Case

Right now switching power via MQTT is not supported. For users using home automation (like openHAB, ioBroker, FHEM,... basically everything else than Home Assistent) there are plenty ways to control a power socket. Unfortunately it's impossible right now to do this. Some simple adaptions would allow these users to control power also via MQTT, please consider implementing a solution. If you want to keep the effort low, you could implement a solution that is easy to implement on bambuddys side but requires some effort on home automations side - as long as there is a way at all.

Proposed Solution

There are multiple solutions possible, these are just suggestions:

  1. Bambuddy writes on MQTT topic of the smart plug (if the plug supports this)
  2. Bambuddy uses REST API to connect to a smart plug. Simple implementation: Additional option "REST" beside Tasmota, HA and MQTT. User needs to enter custom URL's for each sensor value / switching action
  3. Bambuddy publishes via MQTT that it intends to perform a print. This way the user can write a script that enables the power plug on smart home side

Alternatives Considered

No response

Feature Category

Smart Plugs

Priority

Would improve my workflow

Mockups or Examples

Image

Contribution

  • I would be willing to help implement this feature

Checklist

  • I have searched existing issues to ensure this feature hasn't already been requested
Originally created by @Percy2Live on GitHub (Feb 20, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/472 Originally assigned to: @maziggy on GitHub. ### Problem or Use Case Right now switching power via MQTT is not supported. For users using home automation (like openHAB, ioBroker, FHEM,... basically everything else than Home Assistent) there are plenty ways to control a power socket. Unfortunately it's impossible right now to do this. Some simple adaptions would allow these users to control power also via MQTT, please consider implementing a solution. If you want to keep the effort low, you could implement a solution that is easy to implement on bambuddys side but requires some effort on home automations side - as long as there is a way at all. ### Proposed Solution There are multiple solutions possible, these are just suggestions: 1. Bambuddy writes on MQTT topic of the smart plug (if the plug supports this) 2. Bambuddy uses REST API to connect to a smart plug. Simple implementation: Additional option "REST" beside Tasmota, HA and MQTT. User needs to enter custom URL's for each sensor value / switching action 3. Bambuddy publishes via MQTT that it intends to perform a print. This way the user can write a script that enables the power plug on smart home side ### Alternatives Considered _No response_ ### Feature Category Smart Plugs ### Priority Would improve my workflow ### Mockups or Examples <img width="583" height="236" alt="Image" src="https://github.com/user-attachments/assets/980c1496-897b-4549-a163-a5fecf0a6982" /> ### Contribution - [ ] I would be willing to help implement this feature ### Checklist - [x] I have searched existing issues to ensure this feature hasn't already been requested
BreizhHardware 2026-05-07 00:08:33 +02:00
Author
Owner

@maziggy commented on GitHub (Feb 20, 2026):

Please go ahead. Thanks!

<!-- gh-comment-id:3936622097 --> @maziggy commented on GitHub (Feb 20, 2026): Please go ahead. Thanks!
Author
Owner

@maziggy commented on GitHub (Mar 24, 2026):

Before we commit to building this, I'd like to gauge community interest. If you'd find this feature useful, please give this issue a thumbs up (👍) reaction so we can prioritize accordingly.

<!-- gh-comment-id:4116095341 --> @maziggy commented on GitHub (Mar 24, 2026): Before we commit to building this, I'd like to gauge community interest. If you'd find this feature useful, please give this issue a thumbs up (👍) reaction so we can prioritize accordingly.
Author
Owner

@maziggy commented on GitHub (Apr 1, 2026):

Available/Fixed in branch dev and available with the next release or daily build.

Can someone please test and let me know if it works?

Docs -> https://wiki.bambuddy.cool/features/smart-plugs/?h=rest#adding-a-rest-webhook-plug

<!-- gh-comment-id:4168306146 --> @maziggy commented on GitHub (Apr 1, 2026): Available/Fixed in branch dev and available with the next release or daily build. Can someone please test and let me know if it works? Docs -> https://wiki.bambuddy.cool/features/smart-plugs/?h=rest#adding-a-rest-webhook-plug
Author
Owner

@Percy2Live commented on GitHub (Apr 2, 2026):

tested with iobroker and simple-api. Good news first: turning the printer on and off works. What doesn't work is state, energy and power. By default, ioBroker easily allows me to use an individual GET request to retrieve the state, the energy and the power. But bambuddy expects a single state request that contains all three. ioBroker offers a getBulk() method which I tried to utilize, but bambuddy is somehow unable to extract the information out of that. My GET request

http://192.168.101.10:8087/getBulk/shelly.0.shellyplugsg3%23d0cf13c7ad30%231.Relay0.Switch,shelly.0.shellyplugsg3%23d0cf13c7ad30%231.Relay0.Power,shelly.0.shellyplugsg3%23d0cf13c7ad30%231.Relay0.Energy

returns the following response (state, power and energy):

[{"id":"shelly.0.shellyplugsg3#d0cf13c7ad30#1.Relay0.Switch","val":true,"ts":1775143379988,"ack":true},{"id":"shelly.0.shellyplugsg3#d0cf13c7ad30#1.Relay0.Power","val":9.5,"ts":1775143379988,"ack":true},{"id":"shelly.0.shellyplugsg3#d0cf13c7ad30#1.Relay0.Energy","val":30947.07,"ts":1775143379988,"ack":true}]

This is my bambddy configuration (I also tried passing the arrays without the "$" sign, no difference):

Image

It seems bambuddy cannot resolve the arrays. Another issue I see is the energy factor. Bambuddy expects kWh, the datapoint only contains Wh.

A straight-forward approach would be to allow individual GET-requests for state, power and energy. Also a simple power factor / energy factor would allow users to adapt it to the available datapoints.

Great work so far, thank you very much!

<!-- gh-comment-id:4178685706 --> @Percy2Live commented on GitHub (Apr 2, 2026): tested with iobroker and simple-api. Good news first: turning the printer on and off works. What doesn't work is state, energy and power. By default, ioBroker easily allows me to use an individual GET request to retrieve the state, the energy and the power. But bambuddy expects a single state request that contains all three. ioBroker offers a getBulk() method which I tried to utilize, but bambuddy is somehow unable to extract the information out of that. My GET request `http://192.168.101.10:8087/getBulk/shelly.0.shellyplugsg3%23d0cf13c7ad30%231.Relay0.Switch,shelly.0.shellyplugsg3%23d0cf13c7ad30%231.Relay0.Power,shelly.0.shellyplugsg3%23d0cf13c7ad30%231.Relay0.Energy` returns the following response (state, power and energy): `[{"id":"shelly.0.shellyplugsg3#d0cf13c7ad30#1.Relay0.Switch","val":true,"ts":1775143379988,"ack":true},{"id":"shelly.0.shellyplugsg3#d0cf13c7ad30#1.Relay0.Power","val":9.5,"ts":1775143379988,"ack":true},{"id":"shelly.0.shellyplugsg3#d0cf13c7ad30#1.Relay0.Energy","val":30947.07,"ts":1775143379988,"ack":true}]` This is my bambddy configuration (I also tried passing the arrays without the "$" sign, no difference): <img width="478" height="493" alt="Image" src="https://github.com/user-attachments/assets/0bd841ca-5063-4158-858b-48704fcf8d40" /> It seems bambuddy cannot resolve the arrays. Another issue I see is the energy factor. Bambuddy expects kWh, the datapoint only contains Wh. A straight-forward approach would be to allow individual GET-requests for state, power and energy. Also a simple power factor / energy factor would allow users to adapt it to the available datapoints. Great work so far, thank you very much!
Author
Owner

@maziggy commented on GitHub (Apr 3, 2026):

Available/Fixed in branch dev and available with the next release or daily build. Please let me kow if it works now.

<!-- gh-comment-id:4182135196 --> @maziggy commented on GitHub (Apr 3, 2026): Available/Fixed in branch dev and available with the next release or daily build. Please let me kow if it works now.
Author
Owner

@Wolfi913 commented on GitHub (Apr 5, 2026):

Hope that helps you further.
I tested the daily build and it works perfectly.
Also with ioBroker and in my case the RestAPI-adapter.

Image Image Image

This is really a good addition.

<!-- gh-comment-id:4188686412 --> @Wolfi913 commented on GitHub (Apr 5, 2026): Hope that helps you further. I tested the daily build and it works perfectly. Also with **ioBroker** and in my case the **RestAPI-adapter**. <img width="757" height="1507" alt="Image" src="https://github.com/user-attachments/assets/82cadcca-8488-453d-af29-61574dc55450" /> <img width="745" height="762" alt="Image" src="https://github.com/user-attachments/assets/064e3ec5-1a56-47da-b525-dc7ebe7671ab" /> <img width="1032" height="131" alt="Image" src="https://github.com/user-attachments/assets/f6c254f4-fefb-4bf2-8201-82b7071d0fe1" /> This is really a good addition.
Author
Owner

@maziggy commented on GitHub (Apr 5, 2026):


If you find Bambuddy useful, please consider giving it a on GitHub — it helps others discover the project!

<!-- gh-comment-id:4188715037 --> @maziggy commented on GitHub (Apr 5, 2026): ----- If you find Bambuddy useful, please consider giving it a ⭐ on [GitHub](https://github.com/maziggy/bambuddy) — it helps others discover the project!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#294
No description provided.