Open zyphlar opened 1 year ago
I think it is possible to get this information via https://lanternpowermonitor.com/console
I know that some integrations in home assistant get their info from a xml.
Hitting a button to generate a monthly data dump which you can then download via another button isn't quite the same thing as an API. Technically possible, but I'd feel bad about doing it to @MarkBryanMilligan 's servers without checking especially when the goal would be near-realtime data.
The hubs already support posting data to an MQTT topic. The problem is that the hubs post the power for every breaker every single second and transforming it from that into something that HomeAssistant can consume will take a little effort. I put it out there about a year ago hoping that an HA superuser would play around with it, but no one has so far. Looking at their sensor model I think it would work better if the primary hub pulled down the aggregated per-minute summary (what the phone apps get) and bundle that up into HA's metered format. It's totally doable, but as someone who doesn't use HomeAssistant, I've been quietly waiting for a HA superuser to speak up and help to tackle the issue.
Why no just give the option to set up MQTT natively? (think Tasmota)
I am using the Lantern Power monitor with Home Assistant.
Now you can add the sensor as an energy device to the HA energy dashboard.
OK it took me some extra doing but here's how I got it more or less working (I think:)
{
"host": "https://lanternpowermonitor.com/currentmonitor/",
"auth_code": "your_auth_code_here",
"hub": 0,
"debug": false,
"connect_timeout": 3000,
"socket_timeout": 5000,
"needs_calibration": false,
"mqtt_voltage_calibration_factor": 0.0,
"mqtt_port_calibration_factor": 1.0,
"mqtt_frequency": 60,
"mqtt_broker_url": "tcp://homeassistant.local:1883",
"mqtt_user_name": "your_lantern_user_here",
"mqtt_password": "your_password_here"
}
sudo systemctl restart currentmonitor
# MQTT
mqtt:
sensor:
- name: "Breaker 1"
unique_id: lantern_breaker_1
state_topic: "lantern_power_monitor/breaker_power/1-1"
qos: 2
unit_of_measurement: "W"
device_class: energy
value_template: "{{ value_json.power }}"
- name: "Breaker 2"
unique_id: lantern_breaker_2
state_topic: "lantern_power_monitor/breaker_power/1-2"
qos: 2
unit_of_measurement: "W"
device_class: energy
value_template: "{{ value_json.power }}"
ha core restart
)@zyphlar Thanks for the info, That was all I needed to get the rest of the way to get the data to HA.
@MarkBryanMilligan I think this thread is the only place besides the source where mqtt_broker_url etc are mentioned, do you think you could maybe copy paste some of this at the bottom of the readme for future travelers? The setup is pretty sweet when it works. Any future plans for the project?
Being able to send power data to Homeassistant would be pretty cool! Obviously a "would be nice" feature.
https://www.home-assistant.io/blog/2021/08/04/home-energy-management/