Hauptmenü

Clock display

Begonnen von cmillsy, 11 Juni 2014, 18:57:25

Vorheriges Thema - Nächstes Thema

cmillsy

I'm very new to programming in perl so was just wanting to ask this before delving into programming a module

I'm trying to display a screen (floorplan) with a clock on it. I have a 02 joggler running ubuntu as a bedside alarm clock (written with a small gambas program) but was thinking it might be neater to run the clock display though the browser pointing to my fhem setup. I've seen the javascript way on the wiki but i seem to be getting errors with it.

Would there be a way to define a dummy i could display as the current time (and date preferably) so that longpoll will keep it updated. (not bothered about seconds, just a 1 min refresh).  Otherwise would a new module be needed. Any pointers as to how a module would look, as said, very new to this.


epsrw1

maybe this can help you resolve your task:

http://fhem.de/commandref.html#HTTPMOD

yours,florian
Ich habe keine Ahnung, aber davon wenigstens ganz viel

herrmannj

Hi cmillsy,

I have currently under development what you want, including a alarm clock (and much more). I have a xoro android alarm clock and running the webview control with floorplan (as boiler plate), pretty comparable setup

regards
joerg

rudolfkoenig

Your plan with a dummy and an "at" definition updating it should work, although IMHO is not very pretty.

cmillsy

Thanks for the replies. It looks like the AT update of a dummy wont work. Well it does, but it doesn't get updated through longpoll, and i read somewhere that longpoll isn't triggered 'internally' so i think it needs to be external like the HTTPMOD way. I didn't think of pointing it to a time server, thanks for that. Seems a bit of an extreme way for such a simple task though.

rudolfkoenig

ZitatWell it does, but it doesn't get updated through longpoll

Following works for me (just tested), although I still not consider it pretty:

fhem> define Clock dummy
fhem> attr Clock room ClockRoom
fhem> define ClockUpdate at +*00:00:05 { fhem("set Clock $hms") }
fhem> attr ClockUpdate alignTime 00:00

cmillsy

Ah yes it does. Thanks. This has highlighted another problem for me. Longpoll only seems to work when i access fhem from local LAN. If I try to access it from the internet (either PC or phone, chrome browsers) longpoll doesn't update anything. I tried a fresh install (5.5) after which longpoll worked over the internet but after i did an update it stopped working as before. Everything over LAN is ok. Is this a known issue or should i post the problem elsewhere?

rudolfkoenig

Not sure if this is a FHEM/Application issue, I think it is rather an infrastructure problem.
longpoll is working me from the internet too.


Rince

So:
At first, longpoll didn't work over the internet  :(
Afterwards, you installed fhem 5.5  :)
Everything was running fine  8)
Later you did another update, and now some things do not work any more?  :'(

If this is right, maybe a new thread for the not working anymore things would be a good idea
Wer zu meinen Posts eine Frage schreibt und auf eine Antwort wartet, ist hiermit herzlich eingeladen mich per PN darauf aufmerksam zu machen. (Bitte mit Link zum betreffenden Thread)

alice

Hi,
no not realy. I have fhem on a 7362sl (on USB-Stick) and my installation have about 200 mB inclusive logs and backups. There must be something more on the box. Is there only the folder fhem ? Or are there other folders too ?