Search found 1351 matches

by waaren
Sunday 16 December 2018 20:16
Forum: dzVents
Topic: Script to parse Electricity form P1 Smart Meter reading
Replies: 6
Views: 939

Re: Script to parse Electricity form P1 Smart Meter reading

Gravityz wrote:
Sunday 16 December 2018 18:16
tried the new script but it is generating an error
Status: dzVents: Error (2.4.8): SME 0.1.7: ...ar/scripts/dzVents/generated_scripts/dzV-P1 meter v2.lua:34: attempt to index local 'idx' (a number value)

when i comment out the dz.log line the error is gone.
Thx, corrected in my previous post
by waaren
Sunday 16 December 2018 18:47
Forum: dzVents
Topic: Ownership and rights of files on the Raspberry Pi
Replies: 2
Views: 49

Re: Ownership and rights of files on the Raspberry Pi

Add this to your code local fileName = "your file name" local function osExecute(cmd) local fileHandle = assert(io.popen(cmd, 'r')) local commandOutput = assert(fileHandle:read('*a')) local returnTable = {fileHandle:close()} return commandOutput,returnTable[3] -- rc[3] contains returnCode end local ...
by waaren
Sunday 16 December 2018 15:00
Forum: dzVents
Topic: forEach attribute in .dump to file
Replies: 7
Views: 115

Re: forEach attribute in .dump to file

On my system the owner of these files is the user executing the domoticz binary.
To change this give the command

Code: Select all

sudo chown pi:pi fileName
on the OS level
by waaren
Sunday 16 December 2018 14:47
Forum: dzVents
Topic: forEach attribute in .dump to file
Replies: 7
Views: 115

Re: forEach attribute in .dump to file

In FileZilla I can't copy the files to my Local site (Nas). I have tried to change the file attributes. Still no downloading. I wanted to place the screendumps from FileZilla in this reply, but in the tab Attachments I don't get 'upload file' anymore. Has that to do with the planned relocatoin of t...
by waaren
Sunday 16 December 2018 13:51
Forum: dzVents
Topic: Script to parse Electricity form P1 Smart Meter reading
Replies: 6
Views: 939

Re: Script to parse Electricity form P1 Smart Meter reading

Thanks McMelloW (Dank je wel!) for this script! I'm migrating from Homeseer to Domoticz and reading P1 data was my first attempt to make things work. Your script helped me out and gave me a good idea of what Domitcz is capable off. I only cannot see why the variable local fetchIntervalMins = 1 is d...
by waaren
Sunday 16 December 2018 13:22
Forum: dzVents
Topic: forEach attribute in .dump to file
Replies: 7
Views: 115

Re: forEach attribute in .dump to file

Hey Waaren, Thanks for your reply. That is a way. But I want to do it with 'iteratie' and 'file.write' and so on. It is not only for this purpose, but also as learning moment for other situations. In that case you can use the code below. The dumpTable function used here is almost equal to what dzVe...
by waaren
Saturday 15 December 2018 22:04
Forum: dzVents
Topic: forEach attribute in .dump to file
Replies: 7
Views: 115

Re: forEach attribute in .dump to file

I want to make a textfile with all the attributes of a device. I can print a .dump to the log with: return { on = { devices = { 103 }, }, execute = function(domoticz, Rob1) if (Rob1.dump() ~= nil) then print('Dump: '..Rob1.dump()) end end } I want to iterate through Rob1 and write every item to a t...
by waaren
Saturday 15 December 2018 15:04
Forum: PHP and all others
Topic: MQTT mosquitto problems
Replies: 3
Views: 120

Re: MQTT mosquitto problems

Something must have gone wrong during installation? I installed mosquitto on my PI systems (debian Stretch) as follows sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key sudo apt-key add mosquitto-repo.gpg.key sudo apt-get install mosquitto sudo apt-get install mosquitto-clients sudo...
by waaren
Friday 14 December 2018 0:32
Forum: dzVents
Topic: Persistent data as a variable
Replies: 41
Views: 1906

Re: Persistent data as a variable

I get errors with the second script with a nil value. No variable is mentioned in the logging and there was a line mentioned but my script does not have so much lines. local huidwaarde = dz.utils.round(device.usage,1) and the device with my father in law says Usage electric so i think thats: local ...
by waaren
Friday 14 December 2018 0:12
Forum: dzVents
Topic: blind percentage position
Replies: 9
Views: 518

Re: blind percentage position

Any progress with this script? I need this..:) The script is ready and in use but probably not generic enough to share with a wide audience. I attach it here but I cannot give much support on it. I will try to answer questions to clarify but will not make modifications. So use it at it is and make ...
by waaren
Thursday 13 December 2018 0:41
Forum: dzVents
Topic: How to update one value of wind sensor from DzVents [Solved]
Replies: 2
Views: 120

Re: How to update one value of wind sensor from DzVents [Solved]

I update a wind sensor with data from weerlive.nl from a bash script i could not find how to update only the gust or gustMs value with the value domoticz.data.windGust.maxSince('00:10:00') Any help will be greatly appreciated If you want to update a sensor attribute and do not have new values for o...
by waaren
Wednesday 12 December 2018 22:50
Forum: dzVents
Topic: Persistent data as a variable
Replies: 41
Views: 1906

Re: Persistent data as a variable

Got it almost working, one strange thing, see output: 2018-12-12 10:55:27.647 Status: dzVents: Info: 00 Notificatie.resterende tijd.........= 01:00:30 The difference between curent time and timer was at this moment 30 seconds At line 4 you see: 01:00:30, an hour and 30 seconds! dz.log("00 Notificat...
by waaren
Wednesday 12 December 2018 22:06
Forum: Bugs and Problems
Topic: DzVents - Domoticz.notify issue - using inactive channel sends to ALL channels
Replies: 2
Views: 92

Re: DzVents - Domoticz.notify issue - using inactive channel sends to ALL channels

I was trying to send notifications from DzVents using: domoticz.notify("Subject", "Message", domoticz.PRIORITY_NORMAL, domoticz.NSS_GOOGLE_CLOUD_MESSAGING) Basically the notification went out thru every active channel, where is specifically asked for the NSS_GOOGLE_CLOUD_MESSAGING platform. The syn...
by waaren
Wednesday 12 December 2018 17:13
Forum: dzVents
Topic: Get color of RGBW device in dzVents
Replies: 7
Views: 186

Re: Get color of RGBW device in dzVents

Do you look at the log using the GUI or at the OS level ? Hmm I tried to print just the color now and it is working 10 times in a row now: print(triggeredItem.color) I did get very inconsistent output when dumping using dump(), no color attribute or empty color attribute. Also other missing attribut...
by waaren
Wednesday 12 December 2018 1:49
Forum: dzVents
Topic: Persistent data as a variable
Replies: 41
Views: 1906

Re: Persistent data as a variable

pvklink wrote:Ok, this is much more easier then expected! THANKS agaian!

Almost ready with converting all my LUA scripts
Never asked the question if dzventz is a beter scripting language, but it looks more powerful...
dzVents is 100% Lua
by waaren
Wednesday 12 December 2018 0:06
Forum: Bugs and Problems
Topic: Domoticz sending 'ghost' MQTT switch command
Replies: 4
Views: 88

Re: Domoticz sending 'ghost' MQTT switch command

I think I solved the problem by deleting the persistence file. Found the commands in another thread: Quick but a bit dirty way to delete ALL retained messages is to stop broker and delete persistence file, in my case: sudo service mosquitto stop sudo rm /var/lib/mosquitto/mosquitto.db sudo service ...
by waaren
Tuesday 11 December 2018 23:31
Forum: dzVents
Topic: Persistent data as a variable
Replies: 41
Views: 1906

Re: Persistent data as a variable

Last thing to do, is to publish time of the lines below not as a number but als actual time, is that possible? My experience is dat dat/time conversion are terrible dz.log("00 Notificatie.huidige tijd..............= " .. tostring(now)) dz.log("00 Notificatie.timer.....................= " .. tostrin...
by waaren
Tuesday 11 December 2018 23:00
Forum: Bugs and Problems
Topic: Domoticz sending 'ghost' MQTT switch command
Replies: 4
Views: 88

Re: Domoticz sending 'ghost' MQTT switch command

My Domoticz system is rebooted every day. At reboot, the system always sends a switch command to one of my Sonoff devices. Since the switch controls my x-mas tree, it is turned on every morning at 4 am. Can anybody help me in solving this? Thanks. Most likely this a retained message. Try clearing t...
by waaren
Tuesday 11 December 2018 22:56
Forum: dzVents
Topic: Problems converting LUA to DZVENTZ
Replies: 2
Views: 106

Re: Problems converting LUA to DZVENTZ

pvklink wrote:
Tuesday 11 December 2018 21:22
I dont understand this because i do call to dz.devices['denon_volume'].switchOn()
try changing

Code: Select all

dz.devices['denon_volume'] 
to

Code: Select all

dz.devices('denon_volume')
by waaren
Tuesday 11 December 2018 22:50
Forum: dzVents
Topic: Get color of RGBW device in dzVents
Replies: 7
Views: 186

Re: Get color of RGBW device in dzVents

I am trying to create a color picker for my ambilight TV so I can control the color from domoticz. Got a python script up and running which I can use to switch the effect and color of the ambilight. Also created an RGB dummy device in domoticz. Next I wanted to create a small dzVents scripts which ...