Enever hourly data to Telegram

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

Moderator: leecollings

Post Reply
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Enever hourly data to Telegram

Post by balosa »

Hi all,

I really like the new Enever plugin, it works great.

But it would be great if this data could be used to :
- Send a telegram message when new prices are retrieved, in a neat format
- Each value would be put in a variable (or lowest x values), so devices can use this to make an on/off planning

the current format of the variable in domoticz is like (string) :
{"status":"true","data":[{"datum":"2023-08-25 00:00:00","prijs":"0.105240","prijsAA":"0.300989","prijsAIP":"0.310038","prijsANWB":"0.300969","prijsEE":"0.310648","prijsEVO":"0.300969","prijsEZ":"0.300969","prijsFR":"0.305188","prijsGSL":"0.300969","prijsMDE":"0.300969","prijsNE":"0.301879","prijsTI":"0.301568","prijsVDB":"0.301665","prijsVON":"0.299753","prijsWE":"0.305189","prijsZG":"0.300969","prijsZP":"0.299788"} ...........

This is way above my knowlegde to achieve this, if someone could help me start to write some dzvents code to read each value into a variable that would be great.

The following code is a great start to know when the variable is updated.

So let's say we use "prijsTI" as supplier and we need those hourly values.

Code: Select all

return {
	on = {
		variables = {
			'Enever_Electricity_15',
		},
	},
	logging = {
		level = domoticz.LOG_INFO,
		marker = 'Triggers when variable is updated',
	},
	execute = function(domoticz, variable)
		domoticz.log('Variable ' .. variable.name .. ' was changed', domoticz.LOG_INFO)
		
	domoticz.log(domoticz.variables('Enever_Electricity_15').value,domoticz.LOG_INFO)
		
	end
}
User avatar
waltervl
Posts: 5902
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Enever hourly data to Telegram

Post by waltervl »

The plugin also creates a device with that price from supplier TI. As that is probably the supplier you have chosen.
Easier to send a telegram notification on change of that device.probably doesn't need a script, just use the notification interface on the device widget to set it up.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
njlammerts
Posts: 149
Joined: Wednesday 12 August 2020 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Fryslan
Contact:

Re: Enever hourly data to Telegram

Post by njlammerts »

i had the Enever Dynamic Energy plugin installed on 2 RPI ZeroW with Domoticz (2023.2) , both crashed on march 12.
As it turns out, the Enever plugin maybe the cause of the problem. Now Domoticz does not start, how can I remove/disable the Enever Dynamic Energy plugin an hopefull it wil restart.
curl: (7) 2024-03-14 12:41:25.037 Dummy: Light/Switch (SolarPomp)
Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
2024-03-14 12:41:25.064 EventSystem: Event triggered: 3Weg_2
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
2024-03-14 12:41:29.903 Error: Thread 24 (Thread 0x698fb200 (LWP 829)):
2024-03-14 12:41:29.903 Error: #0 __waitpid (options=0, stat_loc=0x698f9b18, pid=836) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2024-03-14 12:41:29.903 Error: #1 __waitpid (pid=836, stat_loc=0x698f9b18, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
2024-03-14 12:41:29.903 Error: #2 0x0028756c in dumpstack_gdb(bool) ()
2024-03-14 12:41:29.903 Error: #3 0x00287b38 in signal_handler(int, siginfo_t*, void*) ()
2024-03-14 12:41:29.903 Error: #4 <signal handler called>
2024-03-14 12:41:29.903 Error: #5 raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:50
2024-03-14 12:41:29.903 Error: #6 <signal handler called>
2024-03-14 12:41:29.903 Error: #7 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
2024-03-14 12:41:29.903 Error: #8 0x76897280 in __GI_abort () at abort.c:79
2024-03-14 12:41:29.903 Error: #9 0x00906e30 in __gnu_cxx::__verbose_terminate_handler() ()
2024-03-14 12:41:29.903 Error: #10 0x0086a270 in __cxxabiv1::__terminate(void (*)()) ()
2024-03-14 12:41:29.903 Error: #11 0x0086a2e4 in std::terminate() ()
2024-03-14 12:41:29.903 Error: #12 0x00874d94 in __cxa_throw ()
2024-03-14 12:41:29.903 Error: #13 0x00732708 in Json::throwLogicError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
2024-03-14 12:41:29.903 Error: #14 0x0073a330 in Json::Value::operator[](unsigned int) ()
2024-03-14 12:41:29.904 Error: #15 0x0073a818 in Json::Value::operator[](int) ()
2024-03-14 12:41:29.904 Error: #16 0x00443728 in Enever::GetPriceGas(bool) ()
2024-03-14 12:41:29.904 Error: #17 0x00445a30 in Enever::Do_Work() ()
2024-03-14 12:41:29.904 Error: #18 0x008dd334 in execute_native_thread_routine ()
2024-03-14 12:41:29.904 Error: #19 0x76aa3494 in start_thread (arg=0x698fb200) at pthread_create.c:486
2024-03-14 12:41:29.904 Error: #20 0x76956e98 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Aborted
balosa
Posts: 21
Joined: Sunday 17 May 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: Enever hourly data to Telegram

Post by balosa »

hmm I had the same issue long ago, I think I manually edited the database and removed the Enever hardware to solve it
I use http://sqlitebrowser.org to edit the database, don't forget to make a backup first
User avatar
gizmocuz
Posts: 2552
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Enever hourly data to Telegram

Post by gizmocuz »

I just stumbled across this thread... I did not know a plugin like this existed.
Enever is now natively build into Domoticz and you can add it from the hardware page
Quality outlives Quantity!
User avatar
waltervl
Posts: 5902
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Enever hourly data to Telegram

Post by waltervl »

I think the user used the native integration and named it a plugin.
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: Google [Bot] and 1 guest