Hi
Is it possible to create a virtual device with energy reporting that will be displayed in the app and handled in the energy view in the app?
I am thinking of adding a device for the car charger.
Hi
Is it possible to create a virtual device with energy reporting that will be displayed in the app and handled in the energy view in the app?
I am thinking of adding a device for the car charger.
Tar det pÄ norsk jeg
Jeg har en sÄnn flow for termostat pÄ badet mitt, som ikke viser effekt.
Flowen opprettes som Virtual Device og legges i mitt tilfelle som âHeaterâ i samme tom som termostaten.
{
"Id": "rvhkZG2tG5zE0xx",
"ClassId": "HLe9CqYw2ogj4ED",
"Author": "",
"Version": 0,
"CreatedAt": "2020-12-13T01:27:00.256978831+01:00",
"UpdatedAt": "2020-12-13T01:27:30.694732319+01:00",
"Name": "Gulvvarme bad effekt",
"Group": "Power Metering",
"Description": "virtual meter_elec",
"Nodes": [
{
"Id": "1",
"Type": "trigger",
"Label": "Gulvvarme bad",
"SuccessTransition": "2",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_bin_switch/ad:rvhkZG2tG5zE0xx_0",
"Service": "out_bin_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"InputVariableType": "",
"IsValueFilterEnabled": false,
"LookupServiceNameAndLocation": false,
"RegisterAsVirtualService": true,
"Timeout": 0,
"ValueFilter": {
"Value": null,
"ValueType": ""
},
"ValueJPath": "",
"ValueJPathResultType": "",
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": null
},
"Ui": {
"nodeType": "",
"x": 131,
"y": 220
},
"TypeAlias": "Trigger"
},
{
"Id": "2",
"Type": "if",
"Label": "On/Off",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "",
"Operand": "eq",
"RightVariable": {
"Value": true,
"ValueType": "bool"
}
}
],
"FalseTransition": "4",
"TrueTransition": "3"
},
"Ui": {
"nodeType": "",
"x": 146,
"y": 369
},
"TypeAlias": "If condition"
},
{
"Id": "3",
"Type": "action",
"Label": "550w",
"SuccessTransition": "6",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:meter_elec/ad:rvhkZG2tG5zE0xx_0",
"Service": "sensor_power",
"ServiceInterface": "evt.sensor.report",
"Config": {
"DefaultValue": {
"Value": 550,
"ValueType": "float"
},
"IsVariableGlobal": false,
"Props": {
"unit": "W"
},
"RegisterAsVirtualService": true,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": [
"W",
"kWh",
"A",
"V"
]
},
"Ui": {
"nodeType": "",
"x": 36,
"y": 540
},
"TypeAlias": "Action"
},
{
"Id": "4",
"Type": "action",
"Label": "0w",
"SuccessTransition": "6",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:meter_elec/ad:rvhkZG2tG5zE0xx_0",
"Service": "sensor_power",
"ServiceInterface": "evt.sensor.report",
"Config": {
"DefaultValue": {
"Value": 0,
"ValueType": "float"
},
"IsVariableGlobal": false,
"Props": {
"unit": "W"
},
"RegisterAsVirtualService": true,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 252,
"y": 538
},
"TypeAlias": "Action"
},
{
"Id": "6",
"Type": "action",
"Label": "",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:out_bin_switch/ad:rvhkZG2tG5zE0xx_0",
"Service": "out_bin_switch",
"ServiceInterface": "evt.binary.report",
"Config": {
"DefaultValue": {
"Value": "",
"ValueType": ""
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": true,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 135,
"y": 774
},
"TypeAlias": "Action"
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": "parallel"
}
Tror jeg har fÄtt den fra forumet her, eller slack. SÄ jeg skal ikke ha kred for Ä ha laget den
ok, du henter forbruket fra en annen enhet i FH, og viser det i den virtuelle enheten?
Nei, dette er statisk. Siden termostaten ikke har energivisning.
SĂ„ det er mest for egen interesse.
Verdien er reel
aha, ok.
tenkte Ă„ hente forbruk fra https://api.easee.cloud/ og presentere forbruk via en virtuell enhet i FH.
SkjÞnner. Det lar seg nok helt sikkert gjÞre, men usikker pÄ hvordan det lÞses i praksis. Er litt usikker pÄ programmering
Ikke akkurat beste tidspunktet Ä drive Ä jobbe mot easee nÄ, vÊrt delvis nede siden 9.12, meste er vel oppe igjen nÄ. De har hatt litt kapasitetsproblemer
Hei, finnes det noe dokumentasjon for hvordan man definerer en virtual device og manipulerer data for den?
Ă„ hente data fra APIâet til Easee er nĂ„ kurrant.
fikk til svar at easee sitt api ikke er tilgjengelig for sluttbrukere, kun partnere, selv om man som vanlig bruker fÄr hentet ut token.
hÄper Futurehome fÄr pÄ plass stÞtte for de mest brukte elbil laderne pÄ et tidspunkt.
Ja, det hadde vĂŠrt supert om Easee hadde vĂŠrt direkte stĂžttet i FH.
Men, kan det i mellomtiden vÊre en lÞsning Ä gÄ via Home Assistant?
Dette er hva jeg fÄr gjennom de, og i baksystemet er det enda flere verdier tilgjengelig.
Vekker denne trĂ„den. Er det noen som har lykkes med Ă„ implementere en virtual device som rapporterer kWh via âmeter_elecâ service?
Har et rele som styrer en kontaktor. Lasten er konstant, sÄ det handler vel egentlig om Ä finne en stabil mÄte for Ä logge tiden relÚt er innkoblet for deretter Ä rapportere akkumulert forbruk.
SpÞrsmÄlet blir, klarer en Flow Ä hÄndtere variabler mellom ulike instanser? Eller lener man seg pÄ globale variabler?
man kan bruke âlokale variablerâ som virker innenfor den gitt flowen, eller globale variabler som virker pĂ„ tvers av flows
Ja, men hvordan hĂ„ndteres âlokaleâ variabler nĂ„r det kjĂžres flere instanser av samme flow i parallell?
Mulig jeg overkompliserer, men det finnes jo ingen garanti for at det bare sendes en melding om Ä slÄ relÚt av og pÄ. For at kWh rapportering skal fungere sÄ mÄ det nesten rapporteres akkumulert frem til eventuelt reset.
Jeg ser for meg en lĂžsning der (pseudo):
cmd.binary.set(true):
start = timestamp.now()
running = true
cmd.binary.set(false):
kWh += timestamp.now() - start * kW
running = false
time.trigger / cmd.meter.get_report:
if running:
kWh += timestamp.now() - start * kW
start = timestamp.now()
evt.meter.report(kWh)
@alivinco do you have a good input here?
I can try to help but can you try to summarize the problem? Is it only about requesting data from easy REST API and presenting it in FH as a virtual devices-meter? Or it also requires a calculation of consumed energy based on instant power readings either by a simple formula (power is constant) or using an integral function if power is variable?
Thanks @alivinco ,
Thereâs basically two topics within this thread so I understand the confusion. Originally @erlend asked if there was a way to create a virtual device to report energy consumption for Easee EV chargers via their API. This seems to be impossible due to the fact that their API isnât available for end consumers. Ie. weâll need to wait until there is an official playgrounds integration.
Then, I hijacked the thread asking for how to create a virtual device for energy reporting when the load is known and constant.
The setup at my place is a contactor switching a 10kW heater. The contactor is controlled by Heatit Z-water. What Iâm looking for is best practice for setting up a virtual device that reports kWh based on a out_bin_switch
In this case the consumption is a pretty straight forward calculation (hours on * kW). But for the reporting needs to be accumulated (thus, stored) similar to what eg. Z-TRM3 reports.
That led to the question on how local variables are treated when it could be multiple instances of the flow running i parallel.
I see. Local variables are local to flow, and not to flow instance, meaning that all running flow instances can access local variables. The biggest obstacle is missing time measurement functionality (elapsed time between 2 events). A workaround would be to set up a timer trigger (for instance @every10m) within the same flow that would sample data (time between samples is known) , calculate energy, and save to accumulating variable.
FYI. Next version of tpflow will bring a number of new statistical functionality, time functions, read/write time series data, and possibly simple meter as well.