Page 44 of 66
Re: NEW frontpage.html - request comments
Posted: Thursday 14 January 2016 14:50
by havnegata
jannl wrote:G3rard wrote:jannl wrote:I almost never restart Chrome on my Tablet, runs ok for months mostly.
Another question, trying to get live image from my webcam in Frontpage now.
I use a Foscam fi9853ep.
When selecting the little webcam image in the cam setup in Domoticz it works, I just do not seem to be able to find the correct url myself (googled a lot).
For now (a few months), I only take a snapshot when someone rings at the door. This image is displayed in Frontpage and mailed to myself, but motion would be nice as well.
Anyone?
I use a picture of the camera on the frontpage and when I click on the picture it opens the live stream in a popup. For the live stream the stream of Domoticz is used.
This is the code I am using in frontpage.html for the popup:
Code: Select all
<div id="popup_camera"><img src="http://ip:port/camsnapshot.jpg?idx=2&t=" onClick="lightbox_close('camera');" width="640" height="480" onload='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 100)' onerror='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 1000)' class='bigcamera' /></div>
Idx 2 is the idx of the camera.
Maybe this can help you?
Basically this did the trick indeed.
Where do you find the idx of your camera?
Re: NEW frontpage.html - request comments
Posted: Thursday 14 January 2016 15:03
by jannl
[url]http://<your%20domoticz%20ip>:<your%20domoticz%20port>/json.htm?type=cameras[/url]
I didn't know that either, but just guessed it.
Re: NEW frontpage.html - request comments
Posted: Thursday 14 January 2016 15:31
by havnegata
Thanks, will check it tonight when I get home
Re: NEW frontpage.html - request comments
Posted: Friday 15 January 2016 15:27
by havnegata
jannl wrote:[url]http://<your%20domoticz%20ip>:<your%20domoticz%20port>/json.htm?type=cameras[/url]
I didn't know that either, but just guessed it.
Spot on, thanks!
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 8:45
by benotje
Hello I am trying to make a LUA script
my door bell but it gives an error can somebody pushes me in the right direction
- domoticz
- Knipsel.JPG (26.48 KiB) Viewed 3865 times
Code: Select all
if (devicechanged['doorbell']) then
if otherdevices['doorbell_switch']=='Off' then
commandArray['doorbell_switch']='On'
end
end
the error log
2016-01-18 08:32:08.681 EventSystem: reset all events...
2016-01-18 08:32:09.335 Error: EventSystem: Lua script did not return a commandArray
2016-01-18 08:32:16.041 Error: EventSystem: Lua script did not return a commandArray
2016-01-18 08:32:16.145 Error: EventSystem: Lua script did not return a commandArray
2016-01-18 08:32:16.244 Error: EventSystem: Lua script did not return a commandArray
does anyone know the solution
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 9:01
by jvdz
All event scripts should contain this at the top of the script:
and this at the end of the script, returning the wanted change commands:
Jos
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 9:43
by benotje
jvdz wrote:All event scripts should contain this at the top of the script:
and this at the end of the script, returning the wanted change commands:
Jos
Oke Jos
Code: Select all
commandArray = {}
if (devicechanged['doorbell']) then
if otherdevices['doorbell_switch']=='Off' then
commandArray['doorbell_switch']='On'
end
end
return commandArray
the error log
2016-01-18 09:36:59.495 Executing script: /home/pi/domoticz/scripts/domoticz_main
2016-01-18 09:37:00.354 Error: EventSystem: [string "-- ..."]:26: attempt to index global 'devicechanged' (a nil value)
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 9:53
by G3rard
Use
devicechanged['Doorbell']
So with a capital D as you are using looking at the screenprint you enclosed.
The names are case censitive.
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 10:01
by benotje
G3rard wrote:Use
devicechanged['Doorbell']
So with a capital D as you are using looking at the screenprint you enclosed.
The names are case censitive.
oke G3rard
Code: Select all
commandArray = {}
if (devicechanged['Doorbell']) then
if otherdevices['doorbell_switch']=='Off' then
commandArray['doorbell_switch']='On'
end
return commandArray
error log
2016-01-18 09:58:23.880 Error: EventSystem: [string "-- ..."]:30: 'end' expected (to close 'if' at line 26) near
2016-01-18 09:58:25.440 Error: EventSystem: [string "-- ..."]:30: 'end' expected (to close 'if' at line 26) near
....
....
it seems that the doorbell is not local
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 10:05
by G3rard
You have to add an extra end between end and return commandArray.
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 10:14
by benotje
G3rard wrote:You have to add an extra end between end and return commandArray.
Yes no error
but when pressing the bell
and the switch does not turn on
the log
2016-01-18 10:07:00.260 Error: EventSystem: [string "-- ..."]:26: attempt to index global 'devicechanged' (a nil value)
2016-01-18 10:07:00.517 User: gebruiker initiated a switch command
2016-01-18 10:07:00.534 Kodi Notification (192.0.0.0:9777, TTL 1): Doorbell, Doorbell pressed, Icon /home/pi/domoticz/www/images/doorbell48.png
2016-01-18 10:07:00.537 Notification sent (kodi) => Success
2016-01-18 10:07:00.544 Executing script: /home/pi/domoticz/scripts/domoticz_main
2016-01-18 10:07:00.519 (rfx) Chime (Doorbell)
2016-01-18 10:08:00.581 Error: EventSystem: [string "-- ..."]:26: attempt to index global 'devicechanged' (a nil value)
2016-01-18 10:09:00.282 Error: EventSystem: [string "-- ..."]:26: attempt to index global 'devicechanged' (a nil value)
2016-01-18 10:10:00.486 Error: EventSystem: [string "-- ..."]:26: attempt to index global 'devicechanged' (a nil value)
Code: Select all
26 if (devicechanged['Doorbell']) then
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 10:21
by G3rard
Please share the complete LUA script you are using for the doorbell. Seems to be something strange in it.
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 10:26
by benotje
G3rard wrote:Please share the complete LUA script you are using for the doorbell. Seems to be something strange in it.
okay here it is
- LUA
- Knipsel.JPG (77.56 KiB) Viewed 3792 times
ActTime: 1453110240,
ServerTime: "2016-01-18 10:44:00",
Sunrise: "08:37",
Sunset: "16:48",
result: [
{
AddjMulti: 1,
AddjMulti2: 1,
AddjValue: 0,
AddjValue2: 0,
BatteryLevel: 255,
CameraIdx: "2",
CustomImage: 0,
Data: "On",
Description: "",
Favorite: 1,
HardwareID: 1,
HardwareName: "RFXt433E",
HardwareType: "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
HardwareTypeVal: 1,
HaveDimmer: false,
HaveGroupCmd: false,
HaveTimeout: false,
ID: "00F4",
Image: "Light",
IsSubDevice: false,
LastUpdate: "2016-01-18 10:07:00",
Level: 0,
LevelInt: 0,
MaxDimLevel: 0,
Name: "Doorbell",
Notifications: "true",
PlanID: "7",
PlanIDs: [
7,
8
],
Protected: false,
ShowNotifications: true,
SignalLevel: "-",
Status: "",
StrParam1: "",
StrParam2: "",
SubType: "SelectPlus",
SwitchType: "Doorbell",
SwitchTypeVal: 1,
Timers: "false",
Type: "Chime",
TypeImg: "doorbell",
Unit: 90,
Used: 1,
UsedByCamera: true,
XOffset: "0",
YOffset: "0",
idx: "104"
}
],
status: "OK",
title: "Devices"
}
Re: NEW frontpage.html - request comments
Posted: Monday 18 January 2016 21:50
by G3rard
@benotje, did you save the LUA as a Device in the Event page?
The pulldown on the right top now probably says All. Change that to Device and save the LUA script.
Re: NEW frontpage.html - request comments
Posted: Tuesday 19 January 2016 7:26
by benotje
G3rard wrote:@benotje, did you save the LUA as a Device in the Event page?
The pulldown on the right top now probably says All. Change that to Device and save the LUA script.
No I did not but this does not help
I can not specify LUA IDX: 104
after I got my raspberry restart it works
Top Thanks for your help
Now again I can continue, I am happy with it
Re: NEW frontpage.html - request comments
Posted: Tuesday 19 January 2016 21:54
by axelbaas
Already tried the search, but couldn't find the anwser..
I want to use an old ( Sony Xperia Z) smartphone as an 'controller' instead of an tablet.. Did already somebody have this? I mean, is there already a customised CSS for smaller screens?
I started today to adapt the default CSS, but it is al lot of work.. Maybe some can share his CSS..
Re: NEW frontpage.html - request comments
Posted: Sunday 24 January 2016 8:59
by stlaha2007
axelbaas wrote:Already tried the search, but couldn't find the anwser..
I want to use an old ( Sony Xperia Z) smartphone as an 'controller' instead of an tablet.. Did already somebody have this? I mean, is there already a customised CSS for smaller screens?
I started today to adapt the default CSS, but it is al lot of work.. Maybe some can share his CSS..
Hi, looking into this smallerscreen issue to.
Have same wishes. Having a xperia arc and t as spare, and use a z2.
Most anoying is portrait in Chrome.
Im busy with stripping the main css and index.html with all IOS and other stuff and setting screen witdh and height according to device screen. FireFox for Android isnt wonderfull Chrome however is not accepting the directions of screenwidth when screen is onder 7 or 8inch. (less then 800px wide).
Also keep in mind that there are 2 javascript files dashboard.js and probably main.js which contain code to deside on device's useragent how many rowItems will get displayed.
Normal is 3, Custom is 4, Floorplan are none and Mobile 1 big/wide.
My advice make a copy of index.html and call that in your browser on your Z.
Im busy with decoding for now. Hope the above directions can help you build your own...
Question: have you tried the Domoticz App in PlayStore? Perhaps it has some uses instead of custom templates etcetera.
Grtz,
Stephan
Re: NEW frontpage.html - request comments
Posted: Tuesday 26 January 2016 14:15
by Kohen
Question, how to add an RGB switch to the portal?
It comes with this set off data
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "Off, Level: 7 %",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 4,
"HardwareName" : "ZWaveStick",
"HardwareType" : "OpenZWave USB",
"HardwareTypeVal" : 21,
"HaveDimmer" : true,
"HaveGroupCmd" : false,
"HaveTimeout" : false,
"ID" : "00001065",
"Image" : "Light",
"IsSubDevice" : false,
"LastUpdate" : "2016-01-24 21:52:32",
"Level" : 7,
"LevelInt" : 7,
"MaxDimLevel" : 100,
"Name" : "RGBControllerRGBW",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "Off",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "RGBW",
"SwitchType" : "Dimmer",
"SwitchTypeVal" : 7,
"Timers" : "false",
"Type" : "Lighting Limitless/Applamp",
"TypeImg" : "dimmer",
"Unit" : 1,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "105"
},
Re: NEW frontpage.html - request comments
Posted: Thursday 28 January 2016 0:02
by HansLe
Problem solved. I installed the frontpage_setting.js and frontpage.html again and everything works very well.
@G3rard, the Sonos files in the frontpage are not updated with the last changes
Re: NEW frontpage.html - request comments
Posted: Friday 29 January 2016 18:55
by luckydoggie
Hi,
I am having problems with the sonos integration with the plus and minus buttons. I added a selector switch within button, this is working properly.
- Domoticz selector switch
- Capture.PNG (229.76 KiB) Viewed 3310 times
When I add the IDX and change the last digit to "2"
- JS-file
- Capture2.PNG (4.84 KiB) Viewed 3310 times
I do not get anything in the cell. Am I using the wrong switch or am I doing something wrong in the JS-file?
Kind regards,
Tom