Re: Remeha eTwist
Posted: Friday 26 January 2024 19:19
Yes you are correct, only a heat pump. Now working without error messages. Thanks!
I have used code below to only pull today's data. Idea is to update the counter and display consumption/delivery so far.
Code: Select all
import datetime
try:
now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%fZ")
startDay = datetime.datetime.now().strftime("%Y-%m-%d 00:00:00.0")
response = requests.get(
f'https://api.bdrthermea.net/Mobile/api/appliances/{applianceId}/energyconsumption/daily?startDate={startDay}&endDate={now}',
headers=headers
)
response.raise_for_status()
if response.status_code != 200:
Domoticz.Error(f"Error getting device states: {response.status_code}")
return None
response_json = response.json()
heatingEnergyConsumed = response_json["data"][0]["heatingEnergyConsumed"] / 1000
heatingEnergyDelivered = response_json["data"][0]["heatingEnergyDelivered"] / 1000
I have almost the say for the daily calculation, but now the question is how to properly put it in a device? Since if you use these daily values as the current power then it just adds everything up so if at the end of the day you have 20kw used then Domoticz will think the total is around 50ish.bwbboot wrote: ↑Saturday 27 January 2024 12:45I have used code below to only pull today's data. Idea is to update the counter and display consumption/delivery so far.
Code: Select all
import datetime try: now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%fZ") startDay = datetime.datetime.now().strftime("%Y-%m-%d 00:00:00.0") response = requests.get( f'https://api.bdrthermea.net/Mobile/api/appliances/{applianceId}/energyconsumption/daily?startDate={startDay}&endDate={now}', headers=headers ) response.raise_for_status() if response.status_code != 200: Domoticz.Error(f"Error getting device states: {response.status_code}") return None response_json = response.json() heatingEnergyConsumed = response_json["data"][0]["heatingEnergyConsumed"] / 1000 heatingEnergyDelivered = response_json["data"][0]["heatingEnergyDelivered"] / 1000
I added a new branch: called energyconsumption, can you test that one? It is a bit behind on some parts from master so you should delete the dwhtemeperature device. If this is what you want I will update the code to make it a bit more cleaner and wil also add the generated part for you and push it to master but first I would like you to test it .bwbboot wrote: ↑Saturday 27 January 2024 12:45I have used code below to only pull today's data. Idea is to update the counter and display consumption/delivery so far.
Code: Select all
import datetime try: now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%fZ") startDay = datetime.datetime.now().strftime("%Y-%m-%d 00:00:00.0") response = requests.get( f'https://api.bdrthermea.net/Mobile/api/appliances/{applianceId}/energyconsumption/daily?startDate={startDay}&endDate={now}', headers=headers ) response.raise_for_status() if response.status_code != 200: Domoticz.Error(f"Error getting device states: {response.status_code}") return None response_json = response.json() heatingEnergyConsumed = response_json["data"][0]["heatingEnergyConsumed"] / 1000 heatingEnergyDelivered = response_json["data"][0]["heatingEnergyDelivered"] / 1000
Code: Select all
{
'appliances': [
{
'applianceId': '1234',
'applianceOnline': True,
'applianceConnectionStatus': 'Connected',
'applianceType': 'Boiler',
'pairingStatus': 'Paired',
'houseName': 'Home',
'errorStatus': 'Running',
'activeThermalMode': 'HeatingCH',
'operatingMode': 'AutomaticHeating',
'outdoorTemperature': None,
'outdoorTemperatureSource': 'Unknown',
'outdoorTemperatureInformation': {
'outdoorTemperatureSource': 'Unknown',
'internetOutdoorTemperature': None,
'applianceOutdoorTemperature': None,
'utilizeOutdoorTemperature': None,
'internetOutdoorTemperatureExpected': False,
'isDayTime': True,
'weatherCode': 'normal cloudy',
'cloudOutdoorTemperature': 5,
'cloudOutdoorTemperatureStatus': 'Ok'
},
'currentTimestamp': None,
'holidaySchedule': {
'startTime': '0001-01-01T00:00:00Z',
'endTime': '0001-01-01T00:00:00Z',
'active': False
},
'autoFillingMode': 'Disabled',
'autoFilling': {
'mode': 'Disabled',
'status': 'Standby'
},
'waterPressure': 1.7,
'waterPressureOK': True,
'capabilityEnergyConsumption': True,
'capabilityCooling': False,
'capabilityPreHeat': True,
'capabilityMultiSchedule': True,
'capabilityPowerSettings': False,
'capabilityOutdoorTemperature': False,
'capabilityUtilizeOutdoorTemperature': False,
'capabilityInternetOutdoorTemperatureExpected': False,
'hasOverwrittenActivityNames': True,
'gasCalorificValue': 8.7917,
'isActive': True,
'hotWaterZones': [
{
'hotWaterZoneId': '1234',
'applianceId': '1234',
'name': 'DHW',
'zoneType': 'DHW',
'dhwZoneMode': 'Scheduling',
'dhwStatus': 'Idle',
'dhwType': 'Combi',
'nextSwitchActivity': 'Reduced',
'capabilityBoostMode': False,
'dhwTemperature': 52.1,
'targetSetpoint': 60.0,
'reducedSetpoint': 15.0,
'comfortSetPoint': 60.0,
'setPointMin': 40.0,
'setPointMax': 65.0,
'setPointRanges': {
'comfortSetpointMin': 40.0,
'comfortSetpointMax': 65.0,
'reducedSetpointMin': 10.0,
'reducedSetpointMax': 60.0
},
'boostDuration': None,
'boostModeEndTime': None,
'nextSwitchTime': '2024-01-29T21:00:00Z',
'activeDwhTimeProgramNumber': 1
}
],
'climateZones': [
{
'climateZoneId': '1234',
'applianceId': '1234',
'name': 'CIRCA ',
'zoneIcon': 0,
'zoneType': 'CH',
'activeComfortDemand': 'ProducingHeat',
'zoneMode': 'Scheduling',
'controlStrategy': 'RoomTemperatureOnly',
'firePlaceModeActive': False,
'capabilityFirePlaceMode': True,
'roomTemperature': 21.0,
'setPoint': 21.0,
'nextSetpoint': 16.0,
'nextSwitchTime': '2024-01-29T17:00:00Z',
'setPointMin': 5.0,
'setPointMax': 30.0,
'currentScheduleSetPoint': 21.0,
'activeHeatingClimateTimeProgramNumber': 1,
'capabilityCooling': False,
'capabilityTemporaryOverrideEndTime': True,
'preHeat': {
'enabled': True,
'active': False
},
'temporaryOverride': {
'endTime': '0001-01-01T00:00:00Z'
}
}
]
}
]
}
Reason I made the experimental change is, that the heat pump only provides the kWh usage, not the W from which the kWh can be calculated.
Code: Select all
{
"appliances":[
{
"applianceId":"1234",
"applianceOnline":true,
"applianceConnectionStatus":"Connected",
"applianceType":"HeatPump",
"pairingStatus":"Paired",
"houseName":"Home",
"errorStatus":"Running",
"activeThermalMode":"HeatingCH",
"operatingMode":"AutomaticHeating",
"outdoorTemperature":2.5,
"outdoorTemperatureSource":"Wired",
"outdoorTemperatureInformation":{
"outdoorTemperatureSource":"Wired",
"internetOutdoorTemperature":"None",
"applianceOutdoorTemperature":2.5,
"utilizeOutdoorTemperature":"None",
"internetOutdoorTemperatureExpected":false,
"isDayTime":true,
"weatherCode":"Sunny",
"cloudOutdoorTemperature":3,
"cloudOutdoorTemperatureStatus":"Ok"
},
"currentTimestamp":"None",
"holidaySchedule":{
"startTime":"0001-01-01T00:00:00Z",
"endTime":"0001-01-01T00:00:00Z",
"active":false
},
"autoFillingMode":"NotAvailable",
"autoFilling":{
"mode":"NotAvailable",
"status":"NotAvailable"
},
"waterPressure":1.7,
"waterPressureOK":true,
"capabilityEnergyConsumption":true,
"capabilityCooling":false,
"capabilityPreHeat":true,
"capabilityMultiSchedule":true,
"capabilityPowerSettings":false,
"capabilityOutdoorTemperature":true,
"capabilityUtilizeOutdoorTemperature":false,
"capabilityInternetOutdoorTemperatureExpected":false,
"hasOverwrittenActivityNames":true,
"gasCalorificValue":0.0,
"isActive":true,
"hotWaterZones":[
],
"climateZones":[
{
"climateZoneId":"1234",
"applianceId":"1234",
"name":"Zone1",
"zoneIcon":0,
"zoneType":"CH",
"activeComfortDemand":"ProducingHeat",
"zoneMode":"Scheduling",
"controlStrategy":"RoomTemperatureOnly",
"firePlaceModeActive":false,
"capabilityFirePlaceMode":true,
"roomTemperature":21.0,
"setPoint":21.0,
"nextSetpoint":21.0,
"nextSwitchTime":"2024-01-29T19:00:00Z",
"setPointMin":5.0,
"setPointMax":30.0,
"currentScheduleSetPoint":21.0,
"activeHeatingClimateTimeProgramNumber":1,
"capabilityCooling":false,
"capabilityTemporaryOverrideEndTime":true,
"preHeat":{
"enabled":false,
"active":false
},
"temporaryOverride":{
"endTime":"0001-01-01T00:00:00Z"
}
}
]
}
]
}
The type is easily discovered via applianceType. I have 'Heatpump' and you have boiler so that value can be used. But first I want to have this calculation done. I do not have a lot of time so I want to get things done before I do something new.gizmocuz wrote: ↑Monday 29 January 2024 8:53 Question, since you do not have Gas, is it possible to post here your json output?
Here is mine: (i masked the id's)
Could you maybe add the 'gasCalorificValue' as custom sensor?Code: Select all
{ 'appliances': [ { 'applianceId': '1234', 'applianceOnline': True, 'applianceConnectionStatus': 'Connected', 'applianceType': 'Boiler', 'pairingStatus': 'Paired', 'houseName': 'Home', 'errorStatus': 'Running', 'activeThermalMode': 'HeatingCH', 'operatingMode': 'AutomaticHeating', 'outdoorTemperature': None, 'outdoorTemperatureSource': 'Unknown', 'outdoorTemperatureInformation': { 'outdoorTemperatureSource': 'Unknown', 'internetOutdoorTemperature': None, 'applianceOutdoorTemperature': None, 'utilizeOutdoorTemperature': None, 'internetOutdoorTemperatureExpected': False, 'isDayTime': True, 'weatherCode': 'normal cloudy', 'cloudOutdoorTemperature': 5, 'cloudOutdoorTemperatureStatus': 'Ok' }, 'currentTimestamp': None, 'holidaySchedule': { 'startTime': '0001-01-01T00:00:00Z', 'endTime': '0001-01-01T00:00:00Z', 'active': False }, 'autoFillingMode': 'Disabled', 'autoFilling': { 'mode': 'Disabled', 'status': 'Standby' }, 'waterPressure': 1.7, 'waterPressureOK': True, 'capabilityEnergyConsumption': True, 'capabilityCooling': False, 'capabilityPreHeat': True, 'capabilityMultiSchedule': True, 'capabilityPowerSettings': False, 'capabilityOutdoorTemperature': False, 'capabilityUtilizeOutdoorTemperature': False, 'capabilityInternetOutdoorTemperatureExpected': False, 'hasOverwrittenActivityNames': True, 'gasCalorificValue': 8.7917, 'isActive': True, 'hotWaterZones': [ { 'hotWaterZoneId': '1234', 'applianceId': '1234', 'name': 'DHW', 'zoneType': 'DHW', 'dhwZoneMode': 'Scheduling', 'dhwStatus': 'Idle', 'dhwType': 'Combi', 'nextSwitchActivity': 'Reduced', 'capabilityBoostMode': False, 'dhwTemperature': 52.1, 'targetSetpoint': 60.0, 'reducedSetpoint': 15.0, 'comfortSetPoint': 60.0, 'setPointMin': 40.0, 'setPointMax': 65.0, 'setPointRanges': { 'comfortSetpointMin': 40.0, 'comfortSetpointMax': 65.0, 'reducedSetpointMin': 10.0, 'reducedSetpointMax': 60.0 }, 'boostDuration': None, 'boostModeEndTime': None, 'nextSwitchTime': '2024-01-29T21:00:00Z', 'activeDwhTimeProgramNumber': 1 } ], 'climateZones': [ { 'climateZoneId': '1234', 'applianceId': '1234', 'name': 'CIRCA ', 'zoneIcon': 0, 'zoneType': 'CH', 'activeComfortDemand': 'ProducingHeat', 'zoneMode': 'Scheduling', 'controlStrategy': 'RoomTemperatureOnly', 'firePlaceModeActive': False, 'capabilityFirePlaceMode': True, 'roomTemperature': 21.0, 'setPoint': 21.0, 'nextSetpoint': 16.0, 'nextSwitchTime': '2024-01-29T17:00:00Z', 'setPointMin': 5.0, 'setPointMax': 30.0, 'currentScheduleSetPoint': 21.0, 'activeHeatingClimateTimeProgramNumber': 1, 'capabilityCooling': False, 'capabilityTemporaryOverrideEndTime': True, 'preHeat': { 'enabled': True, 'active': False }, 'temporaryOverride': { 'endTime': '0001-01-01T00:00:00Z' } } ] } ] }
It is the amount of energy you can get from 1 m3 gas... would be interested to see if this is fluctuating....
'waterPressureOK' could also be interesting as a switch (on=ok, off = not ok), we could set a alarm/action on this
Maybe you can use some of the 'capability' fields to determine if certain values are available
I merged it to main, sometimes there are difference between the total calculation and the usage of today, but that is because of the update interval of the API.bwbboot wrote: ↑Monday 29 January 2024 9:23Reason I made the experimental change is, that the heat pump only provides the kWh usage, not the W from which the kWh can be calculated.
In the screenshot from Tuk90 it shows a usage of 3000 Watt which isn't the actual usage as you would see with a power meter.
I would expect it to simply display the kWh value.
I added the gascalorificvalue, it is in the main branch. The waterPressureOK value will followgizmocuz wrote: ↑Monday 29 January 2024 8:53 Question, since you do not have Gas, is it possible to post here your json output?
Here is mine: (i masked the id's)
Could you maybe add the 'gasCalorificValue' as custom sensor?Code: Select all
{ 'appliances': [ { 'applianceId': '1234', 'applianceOnline': True, 'applianceConnectionStatus': 'Connected', 'applianceType': 'Boiler', 'pairingStatus': 'Paired', 'houseName': 'Home', 'errorStatus': 'Running', 'activeThermalMode': 'HeatingCH', 'operatingMode': 'AutomaticHeating', 'outdoorTemperature': None, 'outdoorTemperatureSource': 'Unknown', 'outdoorTemperatureInformation': { 'outdoorTemperatureSource': 'Unknown', 'internetOutdoorTemperature': None, 'applianceOutdoorTemperature': None, 'utilizeOutdoorTemperature': None, 'internetOutdoorTemperatureExpected': False, 'isDayTime': True, 'weatherCode': 'normal cloudy', 'cloudOutdoorTemperature': 5, 'cloudOutdoorTemperatureStatus': 'Ok' }, 'currentTimestamp': None, 'holidaySchedule': { 'startTime': '0001-01-01T00:00:00Z', 'endTime': '0001-01-01T00:00:00Z', 'active': False }, 'autoFillingMode': 'Disabled', 'autoFilling': { 'mode': 'Disabled', 'status': 'Standby' }, 'waterPressure': 1.7, 'waterPressureOK': True, 'capabilityEnergyConsumption': True, 'capabilityCooling': False, 'capabilityPreHeat': True, 'capabilityMultiSchedule': True, 'capabilityPowerSettings': False, 'capabilityOutdoorTemperature': False, 'capabilityUtilizeOutdoorTemperature': False, 'capabilityInternetOutdoorTemperatureExpected': False, 'hasOverwrittenActivityNames': True, 'gasCalorificValue': 8.7917, 'isActive': True, 'hotWaterZones': [ { 'hotWaterZoneId': '1234', 'applianceId': '1234', 'name': 'DHW', 'zoneType': 'DHW', 'dhwZoneMode': 'Scheduling', 'dhwStatus': 'Idle', 'dhwType': 'Combi', 'nextSwitchActivity': 'Reduced', 'capabilityBoostMode': False, 'dhwTemperature': 52.1, 'targetSetpoint': 60.0, 'reducedSetpoint': 15.0, 'comfortSetPoint': 60.0, 'setPointMin': 40.0, 'setPointMax': 65.0, 'setPointRanges': { 'comfortSetpointMin': 40.0, 'comfortSetpointMax': 65.0, 'reducedSetpointMin': 10.0, 'reducedSetpointMax': 60.0 }, 'boostDuration': None, 'boostModeEndTime': None, 'nextSwitchTime': '2024-01-29T21:00:00Z', 'activeDwhTimeProgramNumber': 1 } ], 'climateZones': [ { 'climateZoneId': '1234', 'applianceId': '1234', 'name': 'CIRCA ', 'zoneIcon': 0, 'zoneType': 'CH', 'activeComfortDemand': 'ProducingHeat', 'zoneMode': 'Scheduling', 'controlStrategy': 'RoomTemperatureOnly', 'firePlaceModeActive': False, 'capabilityFirePlaceMode': True, 'roomTemperature': 21.0, 'setPoint': 21.0, 'nextSetpoint': 16.0, 'nextSwitchTime': '2024-01-29T17:00:00Z', 'setPointMin': 5.0, 'setPointMax': 30.0, 'currentScheduleSetPoint': 21.0, 'activeHeatingClimateTimeProgramNumber': 1, 'capabilityCooling': False, 'capabilityTemporaryOverrideEndTime': True, 'preHeat': { 'enabled': True, 'active': False }, 'temporaryOverride': { 'endTime': '0001-01-01T00:00:00Z' } } ] } ] }
It is the amount of energy you can get from 1 m3 gas... would be interested to see if this is fluctuating....
'waterPressureOK' could also be interesting as a switch (on=ok, off = not ok), we could set a alarm/action on this
Maybe you can use some of the 'capability' fields to determine if certain values are available
I also added the water pressure 'alarm' deviceTuk90 wrote: ↑Saturday 03 February 2024 15:56I added the gascalorificvalue, it is in the main branch. The waterPressureOK value will followgizmocuz wrote: ↑Monday 29 January 2024 8:53 Question, since you do not have Gas, is it possible to post here your json output?
Here is mine: (i masked the id's)
Could you maybe add the 'gasCalorificValue' as custom sensor?Code: Select all
{ 'appliances': [ { 'applianceId': '1234', 'applianceOnline': True, 'applianceConnectionStatus': 'Connected', 'applianceType': 'Boiler', 'pairingStatus': 'Paired', 'houseName': 'Home', 'errorStatus': 'Running', 'activeThermalMode': 'HeatingCH', 'operatingMode': 'AutomaticHeating', 'outdoorTemperature': None, 'outdoorTemperatureSource': 'Unknown', 'outdoorTemperatureInformation': { 'outdoorTemperatureSource': 'Unknown', 'internetOutdoorTemperature': None, 'applianceOutdoorTemperature': None, 'utilizeOutdoorTemperature': None, 'internetOutdoorTemperatureExpected': False, 'isDayTime': True, 'weatherCode': 'normal cloudy', 'cloudOutdoorTemperature': 5, 'cloudOutdoorTemperatureStatus': 'Ok' }, 'currentTimestamp': None, 'holidaySchedule': { 'startTime': '0001-01-01T00:00:00Z', 'endTime': '0001-01-01T00:00:00Z', 'active': False }, 'autoFillingMode': 'Disabled', 'autoFilling': { 'mode': 'Disabled', 'status': 'Standby' }, 'waterPressure': 1.7, 'waterPressureOK': True, 'capabilityEnergyConsumption': True, 'capabilityCooling': False, 'capabilityPreHeat': True, 'capabilityMultiSchedule': True, 'capabilityPowerSettings': False, 'capabilityOutdoorTemperature': False, 'capabilityUtilizeOutdoorTemperature': False, 'capabilityInternetOutdoorTemperatureExpected': False, 'hasOverwrittenActivityNames': True, 'gasCalorificValue': 8.7917, 'isActive': True, 'hotWaterZones': [ { 'hotWaterZoneId': '1234', 'applianceId': '1234', 'name': 'DHW', 'zoneType': 'DHW', 'dhwZoneMode': 'Scheduling', 'dhwStatus': 'Idle', 'dhwType': 'Combi', 'nextSwitchActivity': 'Reduced', 'capabilityBoostMode': False, 'dhwTemperature': 52.1, 'targetSetpoint': 60.0, 'reducedSetpoint': 15.0, 'comfortSetPoint': 60.0, 'setPointMin': 40.0, 'setPointMax': 65.0, 'setPointRanges': { 'comfortSetpointMin': 40.0, 'comfortSetpointMax': 65.0, 'reducedSetpointMin': 10.0, 'reducedSetpointMax': 60.0 }, 'boostDuration': None, 'boostModeEndTime': None, 'nextSwitchTime': '2024-01-29T21:00:00Z', 'activeDwhTimeProgramNumber': 1 } ], 'climateZones': [ { 'climateZoneId': '1234', 'applianceId': '1234', 'name': 'CIRCA ', 'zoneIcon': 0, 'zoneType': 'CH', 'activeComfortDemand': 'ProducingHeat', 'zoneMode': 'Scheduling', 'controlStrategy': 'RoomTemperatureOnly', 'firePlaceModeActive': False, 'capabilityFirePlaceMode': True, 'roomTemperature': 21.0, 'setPoint': 21.0, 'nextSetpoint': 16.0, 'nextSwitchTime': '2024-01-29T17:00:00Z', 'setPointMin': 5.0, 'setPointMax': 30.0, 'currentScheduleSetPoint': 21.0, 'activeHeatingClimateTimeProgramNumber': 1, 'capabilityCooling': False, 'capabilityTemporaryOverrideEndTime': True, 'preHeat': { 'enabled': True, 'active': False }, 'temporaryOverride': { 'endTime': '0001-01-01T00:00:00Z' } } ] } ] }
It is the amount of energy you can get from 1 m3 gas... would be interested to see if this is fluctuating....
'waterPressureOK' could also be interesting as a switch (on=ok, off = not ok), we could set a alarm/action on this
Maybe you can use some of the 'capability' fields to determine if certain values are available