Page 1 of 2

Covid19 threat indicator

Posted: Sunday 19 April 2020 9:38
by Toulon7559
In a preview of a (dutch) statistical study they propose a kind of 'covid19 threat calculator' as element on a website:
see https://covid-19calculator.com/nl/ and https://covid-19calculator.com/en/
Based on calculation of absolute humidity this calculator provides a risc-level indication for the spread of the covid19-virus.
Now a semi-static calculator based on manual input of relative humidity and temperature, in 2 language versions (dutch & english).

After some short testing it seems that the example scriptlines need expansion to enable generation of results when embedded in a webpage.
Which of the clever programmers on this forum (as a next step) can turn the example scriptlines into a really online calculator?
First approach = link the calculator to devices in Domoticz giving temperature and relative humidity aiming at automatic feed of the calculator related to your local sensors
Second/Subsequent approach = translation of the indicator output into 'numeric & colorband' data enabling control of a related virtual device in Domoticz.

Disclaimer is deemed prudent & required:
this calculator (with implicit permission) has been borrowed from an upcoming statistical study.
No information is available about the selection of the indicated threat levels.
Considering the stage of the study and the nature of the corona-crisis,
an indication from this calculator at best is informative only and should never be applied for any decisions.

Re: Covid19 threat indicator

Posted: Sunday 19 April 2020 11:41
by HFman
Mm intresting .. no time yet, Nice one for dzvents or python .. let see if we can find some refernce scripts

Re: Covid19 threat indicator

Posted: Sunday 19 April 2020 20:02
by freijn
I can't find the formula used.
Have I overlooked something?

Reading the js script there is a lot of Facebook shit in there...

Re: Covid19 threat indicator

Posted: Monday 20 April 2020 10:39
by Toulon7559
@freijn

'No formula visible, nor explained' is exactly the reason that I set the disclaimer:
not the faintest idea how they come to their conclusions.
Has significant inherent risc, because they might be good statistians, but definitely not meteo-specialists, nor medical experts.
With reverse engineering the conclusion is that for the colourbands they have applied a link to certain levels of MixingRatio.

Considering the kind of organisation, Maurice de Hond probably has well hidden the access to the source-data & formula.

Addition June, 5th:
Without any change to the related text, the colorbands of the calculator have been changed:
perhaps 'due to development', but 'no explanation' is not a sign of stability/reliability .........

Re: Covid19 threat indicator

Posted: Friday 05 June 2020 13:32
by freijn
Anybody worked already on the new durch dashboard???

Re: Covid19 threat indicator

Posted: Friday 05 June 2020 16:26
by elmortero
Please be aware that the domain covid-19calculator.com has been blacklisted by various security websites, among them us-cert.cov, managedsentinel.com

Re: Covid19 threat indicator

Posted: Friday 05 June 2020 17:16
by EddyG
Sorry, but this quote on the website says enough.

Code: Select all

Please appreciate that the article is based on hypotheses

Re: Covid19 threat indicator

Posted: Friday 05 June 2020 19:15
by freijn
freijn wrote: Friday 05 June 2020 13:32 Anybody worked already on the new durch dashboard???
Sorry for my typo's

Was refering to this:

https://coronadashboard.rijksoverheid.nl/

Re: Covid19 threat indicator

Posted: Friday 05 June 2020 22:09
by FireWizard
Hi,

If someone likes to implement some data from the new Dutch Dashboard in his/her application, see:
https://coronadashboard.rijksoverheid.nl/json/NL.json

Regards

Re: Covid19 threat indicator

Posted: Saturday 06 June 2020 21:31
by freijn
And here is the Node Red flow to get the NL Covid data.

Code: Select all

[{"id":"63188193.62ff48","type":"tab","label":"Covid19_NL","disabled":false,"info":""},{"id":"d6ecff61.4213d","type":"inject","z":"63188193.62ff48","name":"Refresh timer","topic":"","payload":"","payloadType":"date","repeat":"900","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":160,"wires":[["bf4840d1.a55768"]]},{"id":"bf4840d1.a55768","type":"http request","z":"63188193.62ff48","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"https://coronadashboard.rijksoverheid.nl/json/NL.json","tls":"","persist":false,"proxy":"","authType":"","x":170,"y":240,"wires":[["b77f63bd.8951e8"]]},{"id":"b77f63bd.8951e8","type":"json","z":"63188193.62ff48","name":"","property":"payload","action":"","pretty":false,"x":150,"y":300,"wires":[["9e2e88f2.dcac3","24738a63.b06e16"]]},{"id":"9e2e88f2.dcac3","type":"function","z":"63188193.62ff48","name":"Split to interesting Covid-19 data","func":"var msg1 ={};\nvar msg2 ={};\nvar msg3 ={};\nvar msg4 ={};\nmsg1.payload = {\"command\":\"udevice\",\"idx\":2414,\"nvalue\":0,\"svalue\":msg.payload.intake_intensivecare_ma.value.toString()};\nmsg2.payload = {\"command\":\"udevice\",\"idx\":2415,\"nvalue\":0,\"svalue\":msg.payload.intake_hospital_ma.value.toString()};\nmsg3.payload = {\"command\":\"udevice\",\"idx\":2416,\"nvalue\":0,\"svalue\":msg.payload.infected_people_total.value.toString()};\nmsg4.payload = {\"command\":\"udevice\",\"idx\":2417,\"nvalue\":0,\"svalue\":msg.payload.reproduction_index.value.toString()};\nreturn [[msg1,msg2,msg3,msg4]]","outputs":1,"noerr":0,"x":240,"y":360,"wires":[["abece6f0.b6da1","c96f43e1.b60c3"]]},{"id":"c96f43e1.b60c3","type":"mqtt out","z":"63188193.62ff48","name":"","topic":"domoticz/in","qos":"2","retain":"false","broker":"bd507d3a.85126","x":570,"y":360,"wires":[]},{"id":"abece6f0.b6da1","type":"debug","z":"63188193.62ff48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":280,"wires":[]},{"id":"24738a63.b06e16","type":"debug","z":"63188193.62ff48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":220,"wires":[]},{"id":"4c1521d0.c0fb2","type":"comment","z":"63188193.62ff48","name":"Please open me for Sensor text information","info":"msg1 = Intensive care-opnames per dag\nAantal opnames per dag, gemiddeld over de afgelopen 3 dage\n\nmsg2 = Ziekenhuisopnames per dag\nAantal opnames per dag, gemiddeld over de afgelopen 3 dagen.\n\nmsg3 = Total infected People\n\nmsg4 = Reproductiegetal\nAantal mensen dat besmet wordt door één besmettelijke persoon.","x":270,"y":400,"wires":[]},{"id":"bd507d3a.85126","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]

Re: Covid19 threat indicator

Posted: Sunday 07 June 2020 8:58
by akamming
i managed to the the data into domoticz by creating a small python script/plugin : https://github.com/akamming/domoticz-coronadashboard

it is very basic, so feel free to improve …..

Re: Covid19 threat indicator

Posted: Sunday 07 June 2020 14:41
by freijn
akamming wrote: Sunday 07 June 2020 8:58 i managed to the the data into domoticz by creating a small python script/plugin : https://github.com/akamming/domoticz-coronadashboard

it is very basic, so feel free to improve …..
What I like on your solution is the auto creation of sensors :-)

Re: Covid19 threat indicator

Posted: Sunday 07 June 2020 15:30
by HomeSimpson
Seeing the name of Maurice de Hond says it all... Maybe the forum admin can label this threat as untrustworthy since this can be an health issue if people trust the data.

Re: Covid19 threat indicator

Posted: Sunday 07 June 2020 17:15
by akamming
HomeSimpson wrote: Sunday 07 June 2020 15:30 Seeing the name of Maurice de Hond says it all... Maybe the forum admin can label this threat as untrustworthy since this can be an health issue if people trust the data.
covid19-calculator.com might be untrustworthy, but this thread is now also on the coronadashboard from rijksoverheid which (i hope ;-)) is trustworthy

Re: Covid19 threat indicator

Posted: Sunday 07 June 2020 17:23
by akamming
FireWizard wrote: Friday 05 June 2020 22:09 Hi,

If someone likes to implement some data from the new Dutch Dashboard in his/her application, see:
https://coronadashboard.rijksoverheid.nl/json/NL.json

Regards
i used this in the plugin i mentioned in this thread. I just found out the local region data can also be accessed. If you monitor network activity in chrome (ctrl-shift-i) you can find the underlying URL's. This way i found out that the url https://coronadashboard.rijksoverheid.nl/json/VRxx.json retrieves this data. you have to replace the xx with the actual region code. You can find this region code when you access the dashboard the normal way.

e.g. if you browse to the regional data of Groningen, the url which shows Groningen is https://coronadashboard.rijksoverheid.n ... regio=VR01. The last 2 numbers (01) tell the region code, so this way you can construct the url for the groningen region data in json format: https://coronadashboard.rijksoverheid.nl/json/VR01.json

would be nice if someone can find out the full table with the relation between region and the id

Re: Covid19 threat indicator

Posted: Sunday 07 June 2020 18:04
by FireWizard
Hi,

Finding the full table for the "Veiligheids Regio" (Safety Region), is not so difficult.
It is on Wikipedia. See: https://nl.m.wikipedia.org/wiki/Veiligheidsregio.

Regards

Re: Covid19 threat indicator

Posted: Sunday 07 June 2020 20:32
by akamming
FireWizard wrote: Sunday 07 June 2020 18:04 Hi,

Finding the full table for the "Veiligheids Regio" (Safety Region), is not so difficult.
It is on Wikipedia. See: https://nl.m.wikipedia.org/wiki/Veiligheidsregio.

Regards
tx.. when i have time i'll update the plugin, to specify the regions you want to see as well... (referring to this page for the numbers)

UPDATE: I just updated my plugin (https://github.com/akamming/domoticz-coronadashboard) so it now also converts the Safety Region counters at the dashboard to domoticz sensors, which is quite interesting, cause this is quite local data

I made this just for my programming experience (learning python) and i think it is good to maintain awareness for how things are progressing on the corona front, and having these sensors in a home dashboard can contribute to that… but I would be interested if people could share their use cases on how they use these sensors here...

Re: Covid19 threat indicator

Posted: Saturday 08 August 2020 21:47
by freijn
A new working NL code

Code: Select all

[{"id":"63188193.62ff48","type":"tab","label":"Covid19_NL","disabled":false,"info":""},{"id":"d6ecff61.4213d","type":"inject","z":"63188193.62ff48","name":"Refresh timer","topic":"","payload":"","payloadType":"date","repeat":"900","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":160,"wires":[["bf4840d1.a55768"]]},{"id":"bf4840d1.a55768","type":"http request","z":"63188193.62ff48","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"https://coronadashboard.rijksoverheid.nl/json/NL.json","tls":"","persist":false,"proxy":"","authType":"","x":170,"y":240,"wires":[["b77f63bd.8951e8"]]},{"id":"b77f63bd.8951e8","type":"json","z":"63188193.62ff48","name":"","property":"payload","action":"","pretty":true,"x":150,"y":300,"wires":[["9e2e88f2.dcac3"]]},{"id":"9e2e88f2.dcac3","type":"function","z":"63188193.62ff48","name":"Split to interesting Covid-19 data","func":"var msg1 ={};\nvar msg2 ={};\nvar msg3 ={};\nvar msg4 ={};\nmsg1.payload = {\"command\":\"udevice\",\"idx\":2426,\"nvalue\":0,\"svalue\":msg.payload.intake_intensivecare_ma.last_value.moving_average_ic.toString()};\nmsg2.payload = {\"command\":\"udevice\",\"idx\":2427,\"nvalue\":0,\"svalue\":msg.payload.intake_hospital_ma.last_value.moving_average_hospital.toString()};\nmsg3.payload = {\"command\":\"udevice\",\"idx\":2428,\"nvalue\":0,\"svalue\":msg.payload.infected_people_total.last_value.infected_daily_total.toString()};\nmsg4.payload = {\"command\":\"udevice\",\"idx\":2429,\"nvalue\":0,\"svalue\":msg.payload.reproduction_index_last_known_average.last_value.reproduction_index_avg.toString()};\nreturn [[msg1,msg2,msg3,msg4]]","outputs":1,"noerr":0,"x":240,"y":360,"wires":[["c96f43e1.b60c3","40e622bd.3d54bc"]]},{"id":"c96f43e1.b60c3","type":"mqtt out","z":"63188193.62ff48","name":"","topic":"domoticz/in","qos":"2","retain":"false","broker":"bd507d3a.85126","x":570,"y":360,"wires":[]},{"id":"4c1521d0.c0fb2","type":"comment","z":"63188193.62ff48","name":"Please open me for Sensor text information","info":"msg1 = Intensive care-opnames per dag\nAantal opnames per dag, gemiddeld over de afgelopen 3 dage\n\nmsg2 = Ziekenhuisopnames per dag\nAantal opnames per dag, gemiddeld over de afgelopen 3 dagen.\n\nmsg3 = Total infected People\n\nmsg4 = Reproductiegetal\nAantal mensen dat besmet wordt door één besmettelijke persoon.","x":270,"y":400,"wires":[]},{"id":"40e622bd.3d54bc","type":"debug","z":"63188193.62ff48","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":540,"y":260,"wires":[]},{"id":"bd507d3a.85126","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]

Re: Covid19 threat indicator

Posted: Sunday 09 August 2020 7:22
by Alain
Both the discussed flows give you text values in your dummy devices. That means you can't generate graphs. How would you go about getting the values as integers in a "custom sensor" dummy device?

Re: Covid19 threat indicator

Posted: Monday 10 August 2020 10:06
by freijn
I am using "general custom sensor"

This is the output
Capture.JPG
Capture.JPG (85.4 KiB) Viewed 2049 times