Closed Trashmee closed 1 year ago
I am not sure what the cause of your problem is.
Hi LIttleYoda,
that's it - i get (a lot!) of data via MQTT now, thanks a lot for your superfast response.
Thanks, I'll start playing & let you know if I find something of interest, e.g. with HA integration.
ItsMee
Thanks, I'll start playing & let you know if I find something of interest, e.g. with HA integration.
Just to be sure and avoid misunderstanding. If you have the mqtt integration active in HA, the sensor values should be automatically recognised as a new device.
Nice, didn't use this one, but especially if there is a lot of not yet known parameters it seems very useful. Started working once i reverted the mqtt prefix to homeassistant - thanks for the hint.
ItsMee
@littleyoda: Did you integrated your inverter into the Energy dashboard? If so, do you have a more elegant variant than a template sensor on top of what the mqtt integration delivers?
- sensor:
- name: "PV energy (total Wh)"
unique_id: "pv_energy_total"
unit_of_measurement: "Wh"
device_class: 'energy'
state_class: total_increasing
state: |
{{ states('sensor.metering_totwhout_pv_sma_sunny_tripower_serial') | float(default=0.0) }}
the MQTT implementation is indeed not optimal because of the problem with the conversion of the formats. I have to take a closer look again.
Until now, I have not found a better way than via Templates. I therefore also request the inverter power via Modbus and use this for the energy dashboard.
- name: SMA
type: tcp
host: 192.168.2.161
port: 502
sensors:
- name: sma_power_ac_raw
state_class: measurement
unit_of_measurement: W
slave: 3
address: 30775
count: 2
data_type: int32
scan_interval: 10
min_value: 0
- name: sma_power_ac_l1_raw
unit_of_measurement: W
state_class: measurement
slave: 3
address: 30777
count: 2
data_type: int32
scan_interval: 10
min_value: 0
- name: sma_power_ac_l2_raw
unit_of_measurement: W
state_class: measurement
slave: 3
count: 2
address: 30779
data_type: int32
scan_interval: 10
min_value: 0
- name: sma_power_ac_l3_raw
unit_of_measurement: W
state_class: measurement
slave: 3
count: 2
address: 30781
data_type: int32
scan_interval: 10
min_value: 0
- name: sma_power_total_production
unit_of_measurement: Wh
state_class: total_increasing
device_class: energy
slave: 3
address: 30513
scan_interval: 10
data_type: int64
- name: sma_status
slave: 3
address: 30201
scan_interval: 10
count: 2
data_type: int32
Hi,
I'd really like to get your script working, decoupeling scripts via MQTT is my preferred design. I just got an Tripower X20 installed, but did not yet get your script to work.
requests not installed:
I fixed that by
pip3 install requests
. Just wondering if that's maybe not the right module, as its not mentioned in preqs and the area is similar to below issue.KeyError: 'content-length'
When providing a wrong password I get a different output, so username / password seems to be ok?
My inverter (or browser?) redirects me to https:// , but even when replacing http:// with https:// in your script (and setting verify=false due to the self signed certificate that SMA uses) I get above error.
Did you edit any of the Inverters parameter to make this work? Which type of user access is required for the user to connect with? I tried user + admin. Any help to debug is appreciated, I tried to find stuff in my Browser console, but debugging webapps is not an area i have knowledge in.