Custom block
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact:
Custom block
HI guys,
Being a real noob in coding, i need your help for building a custom block.
I have a nodemcu esp8266 who collecting data from T° sensors DS18B20 and send them to thnigspeak who makes graph
I would like to include this graph (iframe) thingspeak to a blank block but I have no idea how to do it !!!!!
Thanks for your reply
Being a real noob in coding, i need your help for building a custom block.
I have a nodemcu esp8266 who collecting data from T° sensors DS18B20 and send them to thnigspeak who makes graph
I would like to include this graph (iframe) thingspeak to a blank block but I have no idea how to do it !!!!!
Thanks for your reply
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Custom block
Gilles a block with an iframe is likely to look quite bad because it will be small and slowing your page down. I would say try to avoid iframes as much as possible, especially in blocks
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact:
Re: Custom block
Hi Jachym,
thanks for your reply.
May be there is another way to go ??
Thingspeak provide an API request code, see below :
GRT channel feed :
Or GET channel field :
Can we do something with it
thanks for your reply.
May be there is another way to go ??
Thingspeak provide an API request code, see below :
GRT channel feed :
Code: Select all
GET https://api.thingspeak.com/channels/343953/feeds.json?api_key=......&results=2
Code: Select all
GET https://api.thingspeak.com/channels/343953/fields/1.json?api_key=....&results=2- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Custom block
Yes, that would be much easier, parse the JSON file and then display it in the block much better solution then Iframe.
I edited your post and deleted the API keys from the URL
I edited your post and deleted the API keys from the URL
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact:
Re: Custom block
thanks, for deleting the API key jachym
Can you help me or tell me where i can found some tutorial or explanation to do it please.
it seems to difficult for me
Can you help me or tell me where i can found some tutorial or explanation to do it please.
it seems to difficult for me
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Custom block
It depends what information from the API result you want.gillesroszak wrote: ↑Mon Oct 16, 2017 11:48 am thanks, for deleting the API key jachym
Can you help me or tell me where i can found some tutorial or explanation to do it please.
it seems to difficult for me
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact:
Re: Custom block
there will be 2 data series, (soil T° 10 cm and 20 cm) i just want to display the current T° so the last data
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Custom block
OK, email me the URL with the full API key so that I can look at it and I will send you the customized block by email as well
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact:
Re: Custom block
Ok done it
Thanks
Thanks
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Custom block
I sent you the working block.
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact:
Re: Custom block
yes but it does not update ???
What can be the problem ?
What can be the problem ?
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Custom block
It is cached, if you want to change the cache time
go to the script and modify the number:
if (time()-filemtime("cache/data.txt") > 60 * 30) {
in minutes
go to the script and modify the number:
if (time()-filemtime("cache/data.txt") > 60 * 30) {
in minutes
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact:
Re: Custom block
OK if I want an update every 10 mn what should i write ?
Very sorry Jachym but ......
Very sorry Jachym but ......
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Custom block
Change 30 to 10:gillesroszak wrote: ↑Mon Oct 16, 2017 5:55 pm OK if I want an update every 10 mn what should i write ?
Very sorry Jachym but ......
60 * 10
- gillesroszak
- Forecaster

- Posts: 100
- Joined: Sun Aug 20, 2017 1:03 pm
- Location: Kerbach
- Station model: Aercus Weather ranger
- Software: WeeWx on Rpi 0W
- Contact: