How can I retrieve Costs T1 and Costs T2

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

How can I retrieve Costs T1 and Costs T2

Post by HvdW »

I tried to find the right Costs T1 attribute from Settings -> Meters/Counters using a dump() command.

Code: Select all

domoticz.devices('Costs T1').dump()
I used the wrong command.
Which is the right one?
Bugs bug me.
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by HvdW »

Let me ask the question in other words.
It is possible to extract latitude and longitude from settings.

Code: Select all

		local lat = dz.settings.location.latitude
		local long = dz.settings.location.longitude
What is the secret formula for costs T1 and costs T2?
Bugs bug me.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by waltervl »

Are you asking for the tariffs for T1 and T2 that are stored in menu setup - settings, tab counters?

Or are you asking for the calculated costs of T1 and T2 of your P1 smart meter device that has T1 and T2 tarifs (and not using dynamic pricing)?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by HvdW »

waltervl wrote: Saturday 07 December 2024 13:18 Are you asking for the tariffs for T1 and T2 that are stored in menu setup - settings, tab counters?
Yes.
To be used in a dzvents script.
Bugs bug me.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by waltervl »

There is no direct function for this. You probably have to use a Domoticz API call with openUrl() to read them.

Code: Select all

/json.htm?type=command&param=getsettings
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by HvdW »

waltervl wrote: Saturday 07 December 2024 19:11 There is no direct function for this. You probably have to use a Domoticz API call with openUrl() to read them.
Any idea which?
Bugs bug me.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by waltervl »

/json.htm?type=command&param=getsettings
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by HvdW »

waltervl wrote: Saturday 07 December 2024 19:24 Domoticz-ip:8282/json.htm?type=command&param=getsettings
That's the one.
Thanks!

Next:

Code: Select all

 "Location": {
        "Latitude": "52.260183",
        "Longitude": "6.714728"
    },
and

Code: Select all

domoticz.log('domoticz.settings.location.latitude : '..domoticz.settings.location.longitude)
is correct
So with

Code: Select all

    "CostEnergy": "0.2752",
    "CostEnergyR1": "0.1650",
    "CostEnergyR2": "0.1235",
    "CostEnergyT2": "0.2335",
    "CostGas": "1.2153",
    "CostWater": "0.9000",
I'm curious about the correct spelling for

Code: Select all

domoticz.log('domoticz.settings.CostEnergyT2 : '..domoticz.settings.costEnergyT2, domoticz.LOG_INFO)
but I'm afraid latitude and longitude are the only options to choose from in the getsettings menu
Bugs bug me.
User avatar
habahabahaba
Posts: 192
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by habahabahaba »

So why dont you want to take them from json answer ?
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by HvdW »

habahabahaba wrote: Sunday 08 December 2024 12:53 So why dont you want to take them from json answer ?
Of course I can.
I'm just very curious.
Bugs bug me.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How can I retrieve Costs T1 and Costs T2

Post by waltervl »

I think the Dzvents developer had a use case to use location as input into dzvents scripts (like weather, geofencing etc). So there was an interface made. For tariffs he did not have a use case so he did not create an interface.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest