I have the flow, almost, working...
But no matter how, I can't seem to create those two sensors that would output to HA.
Flow:
[{"id":"3a876ef8e2b7724c","type":"tab","label":"Football - TV Data","disabled":false,"info":""},{"id":"74d01cfc7a9abdd7","type":"inject","z":"3a876ef8e2b7724c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":420,"wires":[["e5471dd5b66f244f"]]},{"id":"e5471dd5b66f244f","type":"http request","z":"3a876ef8e2b7724c","name":"Tv Games","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://tudonumclick.com/futebol/jogos-na-tv/","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":330,"y":260,"wires":[["86149b53e0b0da14","3230738a14431e79"]]},{"id":"3230738a14431e79","type":"html","z":"3a876ef8e2b7724c","name":"","property":"payload","outproperty":"payload","tag":"section#page-content h3:nth-child(3)","ret":"html","as":"single","x":720,"y":180,"wires":[["e4b6d316db3faad0"]]},{"id":"86149b53e0b0da14","type":"html","z":"3a876ef8e2b7724c","name":"","property":"payload","outproperty":"payload","tag":"section#page-content table:nth-child(4)","ret":"text","as":"multi","x":670,"y":220,"wires":[["ea5524557a19502c"]]},{"id":"134f6689e7129907","type":"cronplus","z":"3a876ef8e2b7724c","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":120,"y":280,"wires":[["e5471dd5b66f244f"]]},{"id":"e4b6d316db3faad0","type":"function","z":"3a876ef8e2b7724c","name":"Get Dates","func":"var currentDate = msg.payload[0];\n\nvar dates = [];\n\nfunction decodeMonth(encodedString) {\n return encodedString.replace(\"ç\", \"ç\");\n}\n\nfor (var i = 0; i < msg.payload.length; i++) {\n var dayNumber = msg.payload[i].substring(\n msg.payload[i].indexOf(\",\") + 2,\n msg.payload[i].indexOf(\" de\")\n );\n\n var monthName = msg.payload[i].substring(\n msg.payload[i].indexOf(\" de\") + 4,\n msg.payload[i].length\n );\n\n monthName = decodeMonth(monthName); // Decode the month name\n\n var gamesDate = \"\";\n var monthNumber = -1;\n\n if (monthName === \"Janeiro\") {\n monthNumber = \"01\";\n } else if (monthName === \"Fevereiro\") {\n monthNumber = \"02\";\n } else if (monthName === \"Março\") {\n monthNumber = \"03\";\n } else if (monthName === \"Abril\") {\n monthNumber = \"04\";\n } else if (monthName === \"Maio\") {\n monthNumber = \"05\";\n } else if (monthName === \"Junho\") {\n monthNumber = \"06\";\n } else if (monthName === \"Julho\") {\n monthNumber = \"07\";\n } else if (monthName === \"Agosto\") {\n monthNumber = \"08\";\n } else if (monthName === \"Setembro\") {\n monthNumber = \"09\";\n } else if (monthName === \"Outubro\") {\n monthNumber = \"10\";\n } else if (monthName === \"Novembro\") {\n monthNumber = \"11\";\n } else if (monthName === \"Dezembro\") {\n monthNumber = \"12\";\n }\n\n gamesDate = new Date().getFullYear() + \"-\" + monthNumber + \"-\" + dayNumber;\n\n dates.push({\n date: msg.payload[i],\n dayNumber: dayNumber,\n monthName: monthName,\n year: new Date().getFullYear(),\n index: i,\n gamesDate: gamesDate,\n });\n}\n\nreturn [{ payload: { dates: dates } }, null];\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":180,"wires":[["36f0c3524244e3ff","5113ddd5cc6279cd"]]},{"id":"ea5524557a19502c","type":"function","z":"3a876ef8e2b7724c","name":"Get Games","func":"msg.payload = msg.payload.match(/\\d\\d:\\d\\d[^\\d\\d:\\d\\d]*/g)\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1110,"y":240,"wires":[["3fe14e3d1c3f36c3","72f1b0598b2e6cbc"]]},{"id":"efb00e1c0fe3a7ee","type":"debug","z":"3a876ef8e2b7724c","name":"dates","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1350,"y":280,"wires":[]},{"id":"28c7766a24fc6730","type":"debug","z":"3a876ef8e2b7724c","name":"games","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1350,"y":380,"wires":[]},{"id":"36f0c3524244e3ff","type":"debug","z":"3a876ef8e2b7724c","name":"debug Dates","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1350,"y":100,"wires":[]},{"id":"3fe14e3d1c3f36c3","type":"debug","z":"3a876ef8e2b7724c","name":"Debug Games","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1360,"y":160,"wires":[]},{"id":"5113ddd5cc6279cd","type":"ha-sensor","z":"3a876ef8e2b7724c","name":"Sensor Date","entityConfig":"","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1150,"y":320,"wires":[["efb00e1c0fe3a7ee"]]},{"id":"72f1b0598b2e6cbc","type":"ha-sensor","z":"3a876ef8e2b7724c","name":"Sensor Games","entityConfig":"","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1160,"y":380,"wires":[["28c7766a24fc6730"]]}]
Debug:
10/03/2024, 21:34:51node: Debug Games
msg.payload : array[8]
[ "18:30 Leverkusen VfL Wolfsbur…", "19:00 Sampaio Corrêa-RJ Botaf…", "19:00 Sp. Braga B Lourosa CAN…", "19:45 Fiorentina Roma SPORT T…", "19:45 Marseille Nantes ELEVEN…", "20:00 Bétis Villarreal ELEVEN…", "20:30 Benfica Estoril BENFIC…", "21:30 Vasco Nova Iguaçu PFC …" ]
10/03/2024, 21:34:51node: debug Dates
msg.payload : Object
object
dates: array[1]
0: object
date: "Jogos na TV - Domingo, 10 de Março"
dayNumber: "10"
monthName: "Março"
year: 2024
index: 0
gamesDate: "2024-03-10"
Any ideas?