NEW frontpage.html - request comments

Moderator: leecollings

User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: NEW frontpage.html - request comments

Post 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?
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: NEW frontpage.html - request comments

Post 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.
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: NEW frontpage.html - request comments

Post by havnegata »

Thanks, will check it tonight when I get home
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: NEW frontpage.html - request comments

Post 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!
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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
domoticz
Knipsel.JPG (26.48 KiB) Viewed 3858 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
raspberry pi
nas synology
homey
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by jvdz »

All event scripts should contain this at the top of the script:

Code: Select all

commandArray = {}
and this at the end of the script, returning the wanted change commands:

Code: Select all

return commandArray
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by benotje »

jvdz wrote:All event scripts should contain this at the top of the script:

Code: Select all

commandArray = {}
and this at the end of the script, returning the wanted change commands:

Code: Select all

return commandArray
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)
raspberry pi
nas synology
homey
User avatar
G3rard
Posts: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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.
Not using Domoticz anymore
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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
raspberry pi
nas synology
homey
User avatar
G3rard
Posts: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by G3rard »

You have to add an extra end between end and return commandArray.
Not using Domoticz anymore
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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
raspberry pi
nas synology
homey
User avatar
G3rard
Posts: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post by G3rard »

Please share the complete LUA script you are using for the doorbell. Seems to be something strange in it.
Not using Domoticz anymore
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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
LUA
Knipsel.JPG (77.56 KiB) Viewed 3785 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"
}
raspberry pi
nas synology
homey
User avatar
G3rard
Posts: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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.
Not using Domoticz anymore
benotje
Posts: 30
Joined: Saturday 27 December 2014 15:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.20078
Location: Menterwolde,The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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

:D :D after I got my raspberry restart it works

Top Thanks for your help

Now again I can continue, I am happy with it :D :D
raspberry pi
nas synology
homey
axelbaas
Posts: 28
Joined: Thursday 14 January 2016 20:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: NEW frontpage.html - request comments

Post 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..
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: NEW frontpage.html - request comments

Post 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
Kohen
Posts: 23
Joined: Monday 12 October 2015 12:05
Target OS: NAS (Synology & others)
Domoticz version:
Location: Veldhoven, The Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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"
},
Synology NAS 412+, Aeotec stick V5, Aeotec recessed door sensor, Aeotec micro double smart switch, Fibaro Dimmer, iPad 2 with own 3d printed wall mount.
HansLe
Posts: 25
Joined: Wednesday 13 January 2016 21:12
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.3530
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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 ;)
Raspberry Pi B+ | Domoticz v3.4834 | RFXtrx433E | Action sockets and remote control (a cheap solution to start with)
Sonos device: control via Action remote control and EasySonos (via Domoticz scripts)
2 x Chresta TX320, Kaku sensoren, D-link camera
luckydoggie
Posts: 9
Joined: Friday 29 January 2016 18:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: NEW frontpage.html - request comments

Post 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
Domoticz selector switch
Capture.PNG (229.76 KiB) Viewed 3303 times
When I add the IDX and change the last digit to "2"
JS-file
JS-file
Capture2.PNG (4.84 KiB) Viewed 3303 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest