Open cods4 opened 1 year ago
Any ideas? Or am I simply using this wrong?
@ngardiner @MikeBishop
I vaguely recall a charge a while back to treat negative values as the opposite thing, which might have impacted your setup. But that seems to be exactly what you're doing here, so I'm not sure. How do the logs say it's actually interpreting the values it's getting?
How would I see how it is interpreting the value? I have logging level set to 9. I can see it is getting the negative value, but that seems to be all. The WebUI shows 0W for Generation and Consumption.
I am pretty sure when I was running an earlier version of TWCManager, the negative consumption values got interpreted as excess solar. Not sure if this is a configuration issue on my end, or something has changed in the code.
Logfile:
2023-06-06 10:55:20,925 - HASS 10 getConsumption returns -3035.44 2023-06-06 10:55:20,929 - HASS 10 Generation Entity Not Supplied. Not Querying 2023-06-06 10:55:20,935 - β½ Master 10 Number of cars charging now: 0 2023-06-06 10:55:20,939 - β½ Master 10 Total amps all slaves are using: 0.0 2023-06-06 10:55:20,945 - π TeslaAPI 13 Entering car_api_available - next step is to query Tesla API 2023-06-06 10:55:20,950 - π TeslaAPI 13 car_api_available returning True 2023-06-06 10:55:20,954 - π TeslaAPI 09 applyChargeLimit return because under 60 sec since last carApiLastChargeLimitApplyTime 2023-06-06 10:55:20,961 - β½ Master 10 Total amps all slaves are using: 0.0 2023-06-06 10:55:20,966 - β½ Manager 20 Limiting charging to 0.00A - 0.00A = 0.00A. 2023-06-06 10:55:20,971 - β½ Manager 20 Charge when above 8A (minAmpsPerTWC). 2023-06-06 10:55:20,977 - π MQTT 10 MQTT Status: Attempting to Connect 2023-06-06 10:55:21,002 - π MQTT 10 Connected to MQTT Broker with RC: 0 2023-06-06 10:55:21,007 - π MQTT 09 Copy Message Buffer 2023-06-06 10:55:21,011 - π MQTT 09 Clear Message Buffer 2023-06-06 10:55:21,015 - π MQTT 13 Publishing MQTT Topic TWC/config/minAmpsPerTWC (value is 8) 2023-06-06 10:55:21,021 - π MQTT 13 Publishing MQTT Topic TWC/all/maxAmpsForSlaves (value is 0)
Any ideas?
This is the only thing that is causing me issues with TWCManager. I have now worked out the scheduler (only works when configured via the HTTP API) and I am able to control everything else via the HTTP API as the MQTT control method was only working intermittently (regularly disconnecting I think).
This is still an issue AFAIK. As a work around I have set up a template sensor in Home Assistant to convert negative power flow into green energy produciton, and a separate sensor for positive power/consumption.
I have recently got this running again after installing a second TWC. In the process I decided to re-install raspbian etc and the latest V1.3.0 of TWCManager and reconfigure TWCManager from scratch.
I am almost certain that before these changes, I was giving TWCM a single Consumption value from home assistant called sensor.main_power. This was coming directly from a Shelly EM3 which monitors my grid current, voltage, power etc. When my house and solar system is exporting to the grid it reads negative power, and when I am buying energy from the grid it shows positive power.
When I configure this HASS entity as a Consumption meter under the HASS source, TWCM doesn't behave at all like I think it did before. When we are exporting power, everything reads zero, and when we are importing power I get positive consumption readings.
I have also tried the MQTT source using the some value taken directly from the Shelly EM3 and I got the same results.
What I want to do with my main_power sensor is have it feed directly into the 'solar surplus' variable in TWCM when it's negative, and into the Consumption variable when it is positive. What am I doing wrong here?
Here's my config.json
``{ "config": {
The settings path will store the dynamic settings which are defined via the web
} `