You don't need to refresh the page. That's what websockets are for, updating elements without a refresh. By default on load they will be set to true, you need to setup a macro to set the correct state either on ws.connect or on a specific page load. Also, did you add your flipswitch ID to the var "toggles" array within the script.js file? If not do so as such, var toggles = new Array("DemoSwitchselect", "yourflipswitchID", "yournextflipswitchID");
Another note; variables can only exist as persistent or temporary, not both. This can cause this behavior also.
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Webserver, displaying variables
Re: Webserver, displaying variables
Alright, I got the scripts down since it's a shameless copy paste of your script
Do you have an example on ws.connect how to always have the correct variable?
So i played around som more..I can jump between pages ofcourse (it's the same document...) but a refresh or "new session" Does not get the changes at all.
Do you have an example on ws.connect how to always have the correct variable?
So i played around som more..I can jump between pages ofcourse (it's the same document...) but a refresh or "new session" Does not get the changes at all.
Re: Webserver, displaying variables
When the webserver makes a new WS client connection, you will see this event "WSClientConnected". Use that or alternatively on a specific pageload by adding a data-action="something" name="something" and class="datasend" to your page link. An event will be generated each time a user clicks that link thus triggering a refresh of the variables. I updated the last eg.tree with some examples of WS.Client.Connected event. Since your saving your variables as persistent, you can just use the broadcast value webserver action, no need to declare it again. Is everything working for you now?
Last edited by yokel22 on Thu Sep 22, 2016 8:06 pm, edited 2 times in total.
Re: Webserver, displaying variables
I think so, except for the switches staying the same status the last variable set them to. It's not prio one right now but would be nice to understand
now I gotta find a good script of making varibales out of the temps from my rfxtrx433e 
Re: Webserver, displaying variables
Good, you will likely need to periodically poll external devices to keep the data fresh. ScheduleGhost is good for that.