Search found 739 matches

by manjh
Thursday 27 March 2025 9:57
Forum: Other questions and discussions
Topic: How to get daily used and delivered energy value
Replies: 7
Views: 262

Re: How to get daily used and delivered energy value

I keep all meter readings on a daily basis. Every day at 23:59 I pick up all readings of electricity, gas, and PV, and append the values to a file. Over time I have collected a lot of data, useful for further processing. For example: I wrote a flow in Node Red which "predicts" annual usage, based on ...
by manjh
Monday 24 March 2025 19:53
Forum: Python
Topic: Python Plugin: Toyota
Replies: 9
Views: 1476

Re: Python Plugin: Toyota

Just to report that I've succeeded in pulling a lot of information from my Toyota into Domoticz. Starting point was pytoyoda, running on my R-Pi. I modified the example file to write the information into a json formatted file. This file then triggers a flow in Node Red, which reads the file and ...
by manjh
Monday 17 March 2025 19:50
Forum: Python
Topic: Python Plugin: Toyota
Replies: 9
Views: 1476

Re: Python Plugin: Toyota

waltervl wrote: Sunday 16 March 2025 18:46 Did you try with sudo pip install? As that is known solution to solve module loading errors
tried that, no luck.

This morning I discovered there is a NodeRed module for Toyota support, I'll give that a try.
by manjh
Sunday 16 March 2025 14:32
Forum: Python
Topic: Python Plugin: Toyota
Replies: 9
Views: 1476

Re: Python Plugin: Toyota

I tried to pip install arrow, but it comes back saying that has already been satisfied....
by manjh
Sunday 16 March 2025 12:36
Forum: Python
Topic: Python Plugin: Toyota
Replies: 9
Views: 1476

Re: Python Plugin: Toyota

I installed the plugin, plus the required pytoyoda and geopy. When I add the plugin to Domoticz, I get these errors: 2025-03-16 12:33:10.522 Toyota: Worker thread started. 2025-03-16 12:33:10.521 Status: Toyota: Entering work loop. 2025-03-16 12:33:10.522 Status: Toyota: Started. 2025-03-16 12:33:10 ...
by manjh
Friday 14 March 2025 9:38
Forum: DIY Hardware and Protocols
Topic: Nodo Project (Arduino mega ethernet solution)
Replies: 3
Views: 3997

Re: Nodo Project (Arduino mega ethernet solution)

Does anyone still have documentation of the Nodo? Commands, syntax, that sort of thing?
I cannot access any of the old websites!
by manjh
Wednesday 12 March 2025 8:13
Forum: Python
Topic: Python Plugin: Toyota
Replies: 9
Views: 1476

Re: Python Plugin: Toyota

Other question. I expect delivery of a new RAV4 PHEV in the next few weeks, and obviously would like to link it to my Domoticz.
Does anyone have experience using this plugin on a PHEV?
by manjh
Wednesday 12 March 2025 8:12
Forum: Python
Topic: Python Plugin: Toyota
Replies: 9
Views: 1476

Re: Python Plugin: Toyota

Has this problem been solved?
by manjh
Wednesday 12 March 2025 8:09
Forum: Examples & Solutions
Topic: How-to: launch action after a certain time [SOLVED]
Replies: 12
Views: 3664

Re: How-to: launch action after a certain time [SOLVED]

What if someone opens the hot water tap for 25 seconds? And again, and again? Eventually it would leave the boiler cold!
I know it may sound unlikely, but you should code for the worst...
by manjh
Tuesday 18 February 2025 16:31
Forum: dzVents
Topic: Why is dzvents device lookup using name instead of idx
Replies: 15
Views: 820

Re: Why is dzvents device lookup using name instead of idx

But hey, this is what we have to live with here in Domoticz. I fully agree. Once you get to work with Domoticz in a bit lower and technical detail, you will find peculiarities. It shows that Domoticz was developed in an organic way, as a hobby project; not as a professionally designed software ...
by manjh
Thursday 13 February 2025 14:57
Forum: LUA
Topic: Is there a select statement?
Replies: 11
Views: 2588

Re: Is there a select statement?

Why run through all changed variables, instead of return { on = { variables = { 'NFC' } }, execute = function(dz, item) ... do stuff end } This is dzvents, I wanted to stick to pure LUA... But you're right. Instead of looping through the whole list of uservariables, I could just check for ...
by manjh
Thursday 13 February 2025 12:57
Forum: LUA
Topic: Is there a select statement?
Replies: 11
Views: 2588

Re: Is there a select statement?

For everyone that is interested, I found an elegant way to solve my coding problem. It starts with a UserVariable that contains an integer value. For each unique value of that UserVariable, I create a function, called NFCn. This is the code to call the right function, based on the uservariable ...
by manjh
Friday 07 February 2025 9:08
Forum: LUA
Topic: Is there a select statement?
Replies: 11
Views: 2588

Re: Is there a select statement?

If - elseif: local x = 2 -- Example value if x == 1 then -- Code to execute when x is 1 print("x is 1") elseif x == 2 then -- Code to execute when x is 2 print("x is 2") else -- Code to execute for all other cases print("x is something else") end or: local x = 2 -- Example value local actions ...
by manjh
Thursday 06 February 2025 13:39
Forum: LUA
Topic: Is there a select statement?
Replies: 11
Views: 2588

Re: Is there a select statement?

jvdz wrote: Thursday 06 February 2025 9:13 Can't you simply store them in an array using the number as key? That way you should be able to get the command with array[key].
Not sure what you mean. Store what in an array? Get what command?
Could you give a small example?
by manjh
Thursday 06 February 2025 8:57
Forum: LUA
Topic: Is there a select statement?
Replies: 11
Views: 2588

Re: Is there a select statement?

Maybe I should explain the purpose I wanted this for. I use a UserVariable to store a value, coming out of a number of NFC sources. Each value represents a specific command: like "turn on lights", "turn off ventilation", "toggle driveway spotlight", etcetera. My routine picks up that uservariable ...
by manjh
Wednesday 05 February 2025 8:28
Forum: LUA
Topic: Is there a select statement?
Replies: 11
Views: 2588

Is there a select statement?

Hopefully there is a simple answer to this... In other programming languages I can use the select statement to execute parts of code depending on content of a variable. For instance: Assume variable x has a numeric value. Select (x) when (1) do ... end when (2) do ... end otherwise ... end end I ...
by manjh
Sunday 12 January 2025 22:49
Forum: Zigbee
Topic: how to read "electric" values from smartplug
Replies: 4
Views: 220

Re: how to read "electric" values from smartplug

I am not using Lua but dzvents but it seems the 1280 is the total value. With dzvents you can get the today value directly. With Lua I have no idea how to do that, but probably it can be calculated. Ah, that looks promising. Would you be willing to post the dzvents script to pull the information ...
by manjh
Sunday 12 January 2025 17:43
Forum: Zigbee
Topic: how to read "electric" values from smartplug
Replies: 4
Views: 220

how to read "electric" values from smartplug

I have a number of Zigbee smartplugs with energy metering function. They work OK, but I am having a bit of trouble trying to extract values. When I look at the Domoticz device,, it shows: "Today: 0.310 kWh". But when I extract the values in a LUA script (using otherdevices), I get "0.0;1280". What ...
by manjh
Friday 10 January 2025 8:38
Forum: LUA
Topic: return multiple values from function
Replies: 7
Views: 320

Re: return multiple values from function

This should work fine assuming the parameters are all given a value function ExtractElectrics(dev_switch, dev_volt, dev_watt, dev_kwh) return dev_switch, dev_volt, dev_watt, dev_kwh end if there is a change that one is nil you could set the default like this: function ExtractElectrics(dev_switch ...
by manjh
Thursday 09 January 2025 19:47
Forum: LUA
Topic: return multiple values from function
Replies: 7
Views: 320

Re: return multiple values from function

jvdz wrote: Thursday 09 January 2025 18:32 Multiple values are supported, but in the posted example the 2nd-4h variable will be "nil" since the right-hand side function of the "=" only has one value.
I think it always has worked like this in lua.
So how would the statement look according to you?