Blockly "Did it Rain today"

Free domotica! Forums How can I …? Synology NAS Blockly "Did it Rain today"

This topic contains 9 replies, has 2 voices, and was last updated by  djandib 1 year ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #3480

    djandib
    Participant

    Hi there,
    my new projekt is a Zwave Watering system for my garden.
    Actually I still wait for the hardware: Electric Valve (no power-> close), Universal power supply and Fibaro FIB_FGWPF-102 for controling. (I`ll make a seperate note, if it works 🙂

    Now I want to make a blocky to do no watering in the evening, if it already rained this day.
    Therefore first I thought to take the humidity and to say:
    IF humidity from yahoo weather is > 99, save the date to a persistent variable.
    But that`s not the truth…

    So I want to make it with the weather codes.
    Question:
    How can I get the code from the yahoo weather api to use it in Blockly?
    I mean the code e.g. “12” and not the long text…

    Simply “COMPARATOR Munich weather.type = “12” ???

    #3481
    Miss Laura
    Miss Laura
    Moderator

    Hi,

    I’ve just added this parameter to Yahoo Weather.
    Just cleaning up the code a bit now.

    I’ve never launched an update of a package myself before, so I will test it first with the beta testers.
    Are you already a beta tester?

    Here all the parameters we could get from yahoo:

    {
    	"query": {
    		"count": 1,
    		"created": "2016-06-14T14:32:09Z",
    		"lang": "nl",
    		"results": {
    			"channel": {
    				"units": {
    					"distance": "km",
    					"pressure": "mb",
    					"speed": "km/h",
    					"temperature": "C"
    				},
    				"title": "Yahoo! Weather - Antwerp, Antwerp, BE",
    				"link": "http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-972240/",
    				"description": "Yahoo! Weather for Antwerp, Antwerp, BE",
    				"language": "en-us",
    				"lastBuildDate": "Tue, 14 Jun 2016 04:32 PM CEST",
    				"ttl": "60",
    				"location": {
    					"city": "Antwerp",
    					"country": "Belgium",
    					"region": " Antwerp"
    				},
    				"wind": {
    					"chill": "63",
    					"direction": "240",
    					"speed": "40.23"
    				},
    				"atmosphere": {
    					"humidity": "67",
    					"pressure": "33796.17",
    					"rising": "0",
    					"visibility": "25.91"
    				},
    				"astronomy": {
    					"sunrise": "5:26 am",
    					"sunset": "9:59 pm"
    				},
    				"image": {
    					"title": "Yahoo! Weather",
    					"width": "142",
    					"height": "18",
    					"link": "http://weather.yahoo.com",
    					"url": "http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif"
    				},
    				"item": {
    					"title": "Conditions for Antwerp, BE at 03:00 PM CEST",
    					"lat": "51.096989",
    					"long": "4.6078",
    					"link": "http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-972240/",
    					"pubDate": "Tue, 14 Jun 2016 03:00 PM CEST",
    					"condition": {
    						"code": "23",
    						"date": "Tue, 14 Jun 2016 03:00 PM CEST",
    						"temp": "17",
    						"text": "Breezy"
    					},
    					"forecast": [{
    						"code": "12",
    						"date": "14 Jun 2016",
    						"day": "Tue",
    						"high": "17",
    						"low": "12",
    						"text": "Rain"
    					}, {
    						"code": "11",
    						"date": "15 Jun 2016",
    						"day": "Wed",
    						"high": "16",
    						"low": "11",
    						"text": "Showers"
    					}, {
    						"code": "39",
    						"date": "16 Jun 2016",
    						"day": "Thu",
    						"high": "18",
    						"low": "11",
    						"text": "Scattered Showers"
    					}, {
    						"code": "12",
    						"date": "17 Jun 2016",
    						"day": "Fri",
    						"high": "17",
    						"low": "12",
    						"text": "Rain"
    					}, {
    						"code": "28",
    						"date": "18 Jun 2016",
    						"day": "Sat",
    						"high": "16",
    						"low": "11",
    						"text": "Mostly Cloudy"
    					}, {
    						"code": "28",
    						"date": "19 Jun 2016",
    						"day": "Sun",
    						"high": "18",
    						"low": "10",
    						"text": "Mostly Cloudy"
    					}, {
    						"code": "30",
    						"date": "20 Jun 2016",
    						"day": "Mon",
    						"high": "20",
    						"low": "11",
    						"text": "Partly Cloudy"
    					}, {
    						"code": "30",
    						"date": "21 Jun 2016",
    						"day": "Tue",
    						"high": "21",
    						"low": "13",
    						"text": "Partly Cloudy"
    					}, {
    						"code": "30",
    						"date": "22 Jun 2016",
    						"day": "Wed",
    						"high": "21",
    						"low": "15",
    						"text": "Partly Cloudy"
    					}, {
    						"code": "30",
    						"date": "23 Jun 2016",
    						"day": "Thu",
    						"high": "22",
    						"low": "15",
    						"text": "Partly Cloudy"
    					}],
    					"description": "<![CDATA[<img src=\"http://l.yimg.com/a/i/us/we/52/23.gif\"/>\n<BR />\n<b>Current Conditions:</b>\n<BR />Breezy\n<BR />\n<BR />\n<b>Forecast:</b>\n<BR /> Tue - Rain. High: 17Low: 12\n<BR /> Wed - Showers. High: 16Low: 11\n<BR /> Thu - Scattered Showers. High: 18Low: 11\n<BR /> Fri - Rain. High: 17Low: 12\n<BR /> Sat - Mostly Cloudy. High: 16Low: 11\n<BR />\n<BR />\n<a href=\"http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-972240/\">Full Forecast at Yahoo! Weather</a>\n<BR />\n<BR />\n(provided by <a href=\"http://www.weather.com\" >The Weather Channel</a>)\n<BR />\n]]>",
    					"guid": {
    						"isPermaLink": "false"
    					}
    				}
    			}
    		}
    	}
    }
    • This reply was modified 1 year, 3 months ago by Miss Laura Miss Laura.

    Have fun,
    Laura

    #3483

    djandib
    Participant

    Hi Laura,
    no, I`m not already a betatester.
    As you see in your example I need the “condition”: “code”: “23” to interpret it.

    I woud programm a variable like:
    IF code=11 OR code=12 OR code=39
    THEN Variable “RainToday”=Current Date

    #3485
    Miss Laura
    Miss Laura
    Moderator

    I think my code is now done. 🙂
    I will update the package for the beta testers and if they don’t find any issue, I will release it in the next few days.

    Note: I immediately added forecasts for the coming 9 days! 🙂
    It’s a HUGE upgrade of the yahoo weather package.

    Have fun,
    Laura

    #3486

    djandib
    Participant

    Ok, so I wait excited for the next update….
    🙂 🙂 🙂

    #3487
    Miss Laura
    Miss Laura
    Moderator

    I just pushed the update to Cedarview devices (mine) on the beta add-on store.
    If I get the update in a few hours, I know it works and then I can start sharing it quickly with others. 🙂

    Have fun,
    Laura

    #3564
    Miss Laura
    Miss Laura
    Moderator

    Small update:
    every time I install the update in beta, yahoo weather gets uninstalled.

    So Mika does something I do not know how to do :-p
    I’m checking with him and will keep you posted.

    Fyi: just added following product to the store 🙂

    Have fun,
    Laura

    #3628

    djandib
    Participant

    Hi Laura,
    anything new about your Yahoo weather package update?
    Andi

    #3649
    Miss Laura
    Miss Laura
    Moderator

    Hi Andi,

    It’s ready, but apparently I need to build a separate package for every cpu and device type.
    So about 36 different packages.

    I am now working on automating this, so that it takes less time.

    You can contact us inside the live chat and then I will give you already the files for the latest package and instructions. 🙂

    Have fun,
    Laura

    #3706

    djandib
    Participant

    My Problem:
    I want that my garden-sprinkler controls “itself” if it has to sprinkle or not

    My solution:
    Last Rain Day

    Finally if the device “Sonne” = true, there will be water in the evening 😉

    Thanx to Koen and Laura for help

    Andi

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.